you can do this without reading in the entire file all at once. start at a $RID code, read until you hit the next $RID code. what you just read will be one full record from the file. test it, etc. then continue. the only problem will be figuring out how to stop reading once you hit a rid code. you could do some combination of seek and read to read in some data, find a $RID code and seek backwards through the file to the beginning of the code. something like:
$currpos = 0;
while ( read( $dpf, $input, 80, $currpos ) )
{ # get 80 characters from $currpos till EOF
$input =~ m/($RID)(.*?)(?:$RID)/g; #grab a code, data and set pos
# test $1 and $2 for errors
$currpos = pos( $input ) # set pos in file to beginning of next id
}
i think that'll do it... i might be missing something though.
jeff | [reply] [Watch: Dir/Any] [d/l] |