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

Simple file manipulation (lining up fields)

Status
Not open for further replies.

Jackiebaron

Programmer
Nov 29, 2006
5
DE
Hi all

I have the output of a command but the fields spill onto two lines, eg:

# /opt/openv/volmgr/bin/tpconfig -d

0 BE-STK9940B-0402 hcart2 TLD(4) DRIVE=3
/dev/rmt/5cbn UP
1 BE-STK9940B-0405 hcart2 TLD(4) DRIVE=6
/dev/rmt/3cbn UP
2 BE-STK9940B-0408 hcart2 TLD(4) DRIVE=9
/dev/rmt/6cbn UP

....etc

And I want to get all 7 fields onto one line, e.g.:

0 BE-STK9940B-0402 hcart2 TLD(4) DRIVE=3 /dev/rmt/5cbn UP
1 BE-STK9940B-0405 hcart2 TLD(4) DRIVE=6 /dev/rmt/3cbn UP

...etc.

Thanks for any help

jackie

 
A starting point:
/opt/openv/volmgr/bin/tpconfig -d | awk 'NR%2{x=$0;next}{print x $0}'

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
man paste

look at paste - - - - - - -

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top