in reply to Removing the First Line
With quoting adapted for Windows, the following does the magic using a scalar context range operator:
perl -ne "@A=split /,/; print join(q(,), @A[0 .. 3]),qq(\n) if 2 .. -1 +;" temp.txt
Note that a file line number match is implied by the scalar context range operator when numeric constants are used.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Removing the First Line
by jwkrahn (Abbot) on Jan 30, 2007 at 02:48 UTC |