in reply to problem with splitting file on whitespace: how to circumvent inconsistent formatting through file
Hi angela2
I can see that you've already had some great responses - some more easily understood than others; so for posterity here are a couple of one-liners similar to what BrowserUk suggested here Re: problem with splitting file on whitespace: how to circumvent inconsistent formatting through file that also take into account tab delimited columns and numbers with decimal points.
...use $F[n-1] to access column n, e.g. print $F[1] will print the value for column 2.
while (<>) { "...your code here ..." }
See perlrun for a more info as I have only scratched the surface...
Best Wishes,
shadowsong
|
|---|
| 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 05, 2016 at 14:22 UTC |