in reply to New to PERL - file format conversions to do
This is a simple example to get you started:
$/ = \ 7 * 1024; # read 7 K records. while (<>) { # read record into $_ my $info = substr($_, 0, 1000); # put first 1000 bytes in $info my $lab = substr($_, 1000, 1000); my $diagnosis = substr($_, 20000, 49999); my $last = chop; # get last character # now do stuff with that data }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: (dup) Perl for flat file conversions?
by runrig (Abbot) on Jun 07, 2006 at 22:33 UTC |