Kevin Old wrote:
Hello all,
I have run into a situation that I've never faced before. I've always
parsed delimited (comma, pipe, etc) data. Now I'm faced with parsing
fixed-width data. That's fine and I understand how to do it and have
even found a module for it (Parse::FixedLength).
Say I have the following string and the first 10 characters are the
first name, the second 10 are the last name and the next 7 are the
price.
Kevin Old001.000
I understand that with the name fields I can just strip off the \s
characters and then I have my first name, but what about the price?
Some times it could be like 1000.00 or 0100.00....but with the preceding
zeros it makes it confusing. Do I need to explicitly strip off the
preceding zeros?
Any help on dealing with fixed width data is appreciated,
perldoc -f pack
perldoc -f unpack
Should get you started.
http://danconia.org
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]