in reply to Re^2: problem with splitting file on whitespace: how to circumvent inconsistent formatting through file
in thread problem with splitting file on whitespace: how to circumvent inconsistent formatting through file

Can't you just copy and paste some of your data here inside <code> tags? Those will preserve formatting.

Anyway, from this small sample it does look like your columns are fixed width. The first one looks to have either 7 or 8 characters, the second and third 8 characters - try an unpack pattern of "a8 a8 a8" and see what you get. Adjust and extend this pattern as is appropriate for your input data, for example to add another column "a8 a8 a8 a6" and so on.

For a tutorial see "Packing Text" in perlpacktut.

  • Comment on Re^3: problem with splitting file on whitespace: how to circumvent inconsistent formatting through file
  • Select or Download Code

Replies are listed 'Best First'.
Re^4: problem with splitting file on whitespace: how to circumvent inconsistent formatting through file
by angela2 (Sexton) on Jul 04, 2016 at 14:01 UTC
    Ah yes, ok I get it now! Thank you so much! I did try various "a" values (a1, a7, a6 etc) but couldn't figure it out. Thanks, I'm checking out the link :)