Gladstone Daniel - dglads wrote:
Good afternoon all,
Hello,
I am new to Perl, so I ask you in advance for your indulgences.
I have a file of 82,000 lines in a fixed format of 130 characters on
each line, with a line feed.
Given the layout:
Field1 = Position 1-5
Field2 = Position 6-20
Field3 = Position 21-30
and so on and so on for 15 fields.
I want to output/convert it pipe delimited
ie: field1|field2|field3|field4 etc etc
Can someone help get me started in the right direction
while ( <FILEHANDLE> ) {
chomp;
print join( '|', unpack 'a5 a15 a10', $_ ), "\n";
}
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/