in reply to problem with splitting file on whitespace: how to circumvent inconsistent formatting through file
This should work:
print join "\t", split ' *(?=[^0-9,])', '15,567 -25,324-45,234';; 15,567 -25,324 -45,234
As a one-liner:
perl -nle"print join qq[\t], split ' *(?=[^0-9,])'" < bad.file > good. +file
Don't forget to swap 's and "s if you're on *nix.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: problem with splitting file on whitespace: how to circumvent inconsistent formatting through file
by angela2 (Sexton) on Jul 04, 2016 at 14:02 UTC |