On Sep 4, zanardi2k2 said:

>I extract data from an AS/400 table, and i am not able to get a decent
>CSV format.  So i have to choose a fixed-width format. Now i have to get
>all values. Is there something better than:
>
>$var1=substr($_, 0, 10)
>$var2=substr($_, 11, 16)
>$var3=...

Sounds like you want unpack():

  @fields = unpack "A10 x A16 x ...", $_;

The A# means "# characters", and the x means "skip a byte".

  perldoc -f unpack

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to