You're replying to a comment by kyaw.

kyaw Permalink
April 12, 2011, 06:10

if code goes like as awk '{ print ++a, $0 }', line numbering included blank lined. But code goes awk 'NF {$0=++a ": " $0}; {print}' that will be add line number to non-blank line.

NF {$0=++a ": " $0} = There must have one field at lease to increase number to var "a" else no action or not take as record for blank line, same time $0 (whole NR ) will become as [var a : ORG_LINE] then print again with all (whole line which newly create include var a value) by print statement after ; .

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

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

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