Binary File Operations
From: Jeremy Robbins (robbinj_at_pweh.com)
Date: 07/14/04
- Next message: Dave: "padding left-justified string fields"
- Previous message: Paul Porcelli: "Problem with Range Operator sequence number"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 14 Jul 2004 14:45:23 -0700
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
- Next message: Dave: "padding left-justified string fields"
- Previous message: Paul Porcelli: "Problem with Range Operator sequence number"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|