J
Jeremy Robbins
I am trying to complete some operations on a binary file and was
hoping someone could help speed things up a little for me. I can get
everything to work no problem I would just like to speed it up some.
I have rather large files with a bunch of data points. Each data
point represents a different parameter at a different time, I want to
skip times between points.
This code works below but it seems like I should be able to tell Perl
to read a value and then skip some and then read some more instead of
seeking or looping through the file. THis has been faster then
packing and unpacking everything.
$line = "";
while (read(F,$temp,4*$nparm)){
$line = $line.$temp;
sysseek(F,4*($int-1)*$nparm,1);
}
close(F);
#Write the data
syswrite(OUT,$line,length($line));
(left basic stuff out)
thanks
tex
hoping someone could help speed things up a little for me. I can get
everything to work no problem I would just like to speed it up some.
I have rather large files with a bunch of data points. Each data
point represents a different parameter at a different time, I want to
skip times between points.
This code works below but it seems like I should be able to tell Perl
to read a value and then skip some and then read some more instead of
seeking or looping through the file. THis has been faster then
packing and unpacking everything.
$line = "";
while (read(F,$temp,4*$nparm)){
$line = $line.$temp;
sysseek(F,4*($int-1)*$nparm,1);
}
close(F);
#Write the data
syswrite(OUT,$line,length($line));
(left basic stuff out)
thanks
tex