in reply to parsing sloppy text from columns

Another simple yet effective way to eliminate the 'extra' whitespace would be to hit the line with something like this.

@line=~s/ +/ /g;

This should simply eliminate all duplicate whitespace chars and replace them with a single whitespace char so that you then can use a naive split().

Replies are listed 'Best First'.
Re^2: parsing sloppy text from columns (not the solution)
by Aristotle (Chancellor) on May 10, 2003 at 19:29 UTC
    That will break when the columns are not consistently filled with values, f.ex if a value of 0 for some column results in nothing getting printed at all.

    Makeshifts last the longest.

      You are absolutely correct. My solution will ONLY work for a data set where one has confidence in the data and what is presented (ie. you know you have 6 columns and always get 6 columns).

      I appreciate you correcting this - my apologies.