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

Swarup Permalink
September 12, 2012, 11:12

If there are 20 fields in one line and 30 such lines in a file and i want to modify 3rd field of every line with a value say "HERO" and 4th field of every line with a value"ASDF".
What will be the Awk one liner for this.
Can you please respond as this is urgent.

Comment Responses

September 12, 2012, 14:14

Here is how:

awk '{$3="HERO"; $4="ASDF"; print}'

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

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

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