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!

adding field names as first record...

Status
Not open for further replies.

admoore

IS-IT--Management
May 17, 2002
224
US
If I am processing raw comma delimited data using an existing awk script, how can I add one record to the beginning of the output which defines the field names?

As always,

TIA!

-Allen Moore
 
Pls give sample input file and the desired output.
How do you print our output? vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Like this...
Code:
awk -F, -v OFS=, '{
	             $3 = tolower($3);
	             sub ( /,0:00:00/, &quot;&quot; );
	             print
	          }' input.txt > output.txt

{/code]
 
$0 = &quot;my new field&quot; OFS $0 vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top