seaver has asked for the wisdom of the Perl Monks concerning the following question:
Dear all,
I basically have to parse a file that looks like this:
BAZ 'N3'' N 0 ? ? ? 1 BAZ 'N4'' N 0 ? ? ? 1 BAZ 'C8'' C 0 ? ? ? 1 BAZ C9 C 0 ? ? ? 1 BAZ ZN ZN 0 ? ? ? 0 BAZ HN1 H 0 ? ? ? 1 BAZ 1HN2 H 0 ? ? ? 0 BAZ 2HN2 H 0 ? ? ? 0 001 F11 F 0 ? ? ? 1 001 C11 C 0 ? ? ? 1 001 O11 O 0 ? ? ? 1 001 N12 N 0 ? ? ? 1 001 C12 C 0 ? ? ? 1 001 C13 C 0 ? ? ? 1 001 C14 C 0 ? ? ? 1 001 C15 C 0 ? ? ? 1 001 C16 C 0 ? ? ? 1 BCB CBA C 0 ? ? ? 1 BCB CGA C 0 ? ? ? 1 BCB O1A O 0 ? ? ? 1 BCB O2A O 0 ? ? ? 1 BCB 'N B' N 0 ? ? ? 1 BCB C1B C 0 ? ? ? 1 BCB C2B C 0 ? ? ? 1 BCB C3B C 0 ? ? ? 1 BCB C4B C 0 ? ? ? 1 BCB CMB C 0 ? ? ? 1irregular columns means I cant use unpack, BUT, the space in the second column where it says 'N B' HAS to be ignored when splitting!!
I'm hoping there's a third way to do this?
Cheers
Sam
Back to
Seekers of Perl Wisdom