Unix Shell - Re: "from the 4th to the end of the line" - a more elegant way to write it.

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > December 2006 > Re: "from the 4th to the end of the line" - a more elegant way to write it.





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: "from the 4th to the end of the line" - a more elegant way to write it.
Radoulov, Dimitre

2006-12-11, 7:23 pm


"slystoner" wrote in message ...
> cat file | awk {' print $4" "$5" "$6" "$7" "$8" "$9" ... $n '}
>
>
> Where n is a number that I guess large to be sure that all rest ot the
> line will be printed
>
>
> esample:
>
> INPUT FILE:
> I don't like 2 2 2 2 2 2222222 2 2 22 2 2 2
> one two tree 11111111 111111 1111 111111 11 1 1 1
> hey! hey! hey! BLA BLA BLA BLAAAAA B B B B B
>
> OUTPUT:
> 2 2 2 2 2 2222222 2 2 22 2 2 2
> 11111111 111111 1111 111111 11 1 1 1
> BLA BLA BLA BLAAAAA B B B B B



awk '$1=$2=$3="";{print substr($0,4)}' infile



Regards
Dimitre


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com