An Entrepreneur, Coach, IT Consultant, Strategic Adviser, and a Traveler craving to explore and contribute to forming a better society.

Tuesday, December 30, 2008

Shell Scripting #0007 - Adding Some prefix to all lines of a file

No comments :
Keywords: Linux, AWK Programming, Shell Scripts, Scripting, Bash, AWK

Adding Some prefix to all lines of a file: (Category: AWK Programming)

awk -F'\n' -v i=100 '{ print ++i " " $1; }' filename

-F ---> Field Separator/Delimiter
-v ---> variable declaration globally

Keywords: Linux, AWK Programming, Shell Scripts, Scripting, Bash, AWK

Featured Blog Topics:

No comments :