in reply to Re: making a single column out of a two-column text file
in thread making a single column out of a two-column text file

        /(\S*)\s+(\S*)/ or next;

The OP was specifically asking about the problem when one of the columns is empty. It seems this solution will just skip any such line, which I don't think was the OP's intention.

Update as jasonk points out, this is rubbish. I'd misread the * as +.

Hugo

Replies are listed 'Best First'.
Re: Re: Re: making a single column out of a two-column text file
by jasonk (Parson) on Feb 26, 2003 at 02:45 UTC

    No it won't, it matches 0 or more non-white-spaces, followed by one or more white-spaces, followed by 0 or more non-white-spaces. If the first column is empty, that counts as 0 non-white-spaces and $1 will contain the empty string. If the second column is empty that counts as 0 non-white-spaces and $2 will contain the empty string. The only lines that will get skipped are lines that don't contain at least one white-space character.