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
Broken, if the regex ever not matches. Please don't use $1 except in the conditional testing the regex that you think might match.while (<>) { /(\S*)\s+(\S*)/; push @a, $1 if length $1; push @b, $2 if length $2; }
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: making a single column out of a two-column text file
by diotalevi (Canon) on Feb 26, 2003 at 01:56 UTC | |
by merlyn (Sage) on Feb 26, 2003 at 02:20 UTC |