laziness, impatience, and hubris | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
ehm ...
> > spaces before and after the spaces before are IMHO best dealt by stripping them before splitting. ° $line =~ s/^\s+//; Even your pseudo python code can't do this in a one-liner with split (IMHO). But more importantly your definition of "field" is fuzzy now. Please clarify
updateprovided there are no "empty fields" and "multiple whitespaces" are allowed as separators: You can use a regex like /(\S+)/g ( \S is non-whitespace, the opposite of \s) Debugger demo:
Cheers Rolf
update°) or by using the magic of ' ' soonix showed us here. In reply to Re: Extracting selected fields form file record (updated)
by LanX
|
|