You're viewing a comment by vz33 and its responses.

vz33 Permalink
May 15, 2012, 13:20

I have a question: if the field $2, $3.....$n can be short for , while I'd like to print the from $2 to $n (n is a very large number,so I cannot write them all one by one)

Comment Responses

May 16, 2012, 13:36

Use a for loop:

awk '{ for (i=1;i<5;i++) { field = field $i } } { print field }'
vapace Permalink
July 11, 2012, 04:00

In addition to Peter's for loop comment, the n in your question is called NF in awk.

Reply To This Comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the word "coding_122": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.