Binary File Operations

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Reading/writing a dictionary to file problem :( 1
file operations 1
simple Binary File to ASCII 0
binary file parsing 34
problems reading binary file 14
file operations 0
read binary file 3
binary file to CString 2

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top