G'day Galdor,
$ echo "one two three four five six seven eight nine A B C D E F G H A B C D E F G H I J" | perl -pe 's/^(?:\s*\S+\s+){3}//' four five six seven eight nine D E F G H D E F G H I J
Update: Added a '^' anchor to the regex.
Was: s/(?:\s*\S+\s+){3}//
Now: s/^(?:\s*\S+\s+){3}//
It doesn't change the result; but looks more correct.
With a huge history file, it might be a little quicker.
— Ken
In reply to Re: Succint Perl version of Awk
by kcott
in thread Succint Perl version of Awk
by Galdor
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |