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!

Writing fields from one line to multiple files

Status
Not open for further replies.

jping45

Technical User
Aug 22, 2001
49
US
I have command output that has 10 fields in it. I want to pass $1, $3, $4, $5 to some formatting commands and $7 to a temp file. Any suggestions?
 
Hi jping45

How about

{
printf ("%s %s %s %s\n", $1, $3, $4 ,$5)
print $7 > "tmp.dat"
}

Change the printf statement to format the fields appropriately.

Hope this helps.
CaKiwi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top