Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count number of words in a line or the fourth till the last word

Status
Not open for further replies.

wvdw

Programmer
Jul 31, 2000
20
NL
I want to compare lines in a file from the fourth word till the end. I dont know how to find out how many words are in a line that is read by AWK or how fill a variable with $4..$20 (word 4 till 20)<br>Any advice?
 
Words number indicated by special variable NF.<br>So,you can know the how many words in a line.<br>e.g.<br>&nbsp;&nbsp;for(i=4;i&lt;=NF;i++){<br>&nbsp;&nbsp;&nbsp;&nbsp;if($i==....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top