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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Would like to move 2nd column data out to one line..

Status
Not open for further replies.

jdespres

MIS
Aug 4, 1999
230
US
I would like to take the following data:

media ID: P01064
media type: 1/2" cartridge tape (6)
barcode: P01064
media description: ------
volume pool: NetApp_cdcnas02 (3)
robot type: ACS - Automated Cartridge System (1)
robot number: 1
robot slot: 0
robot control host: NONE
volume group: 00_001_ACS
vault name: ---
vault sent date: ---
vault return date: ---
vault slot: ---
vault session id: ---
created: Thu Jul 22 13:51:08 2004
assigned: ---
last mounted: Mon Aug 15 15:21:26 2005
first mount: Tue Aug 31 04:08:04 2004
expiration date: ---
number of mounts: 21
max mounts allowed: ---


and spread 2nd column out to one line.....
 
Code:
BEGIN { FS=":[ \t]+"; ORS="\t" }
{ print $2 }
Save as "spread.awk" and run with
[tt]awk -f spread.awk datafile[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top