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!

Formatting output

Status
Not open for further replies.

mrn

MIS
Apr 27, 2001
3,993
GB
I have a list

P590-AAAc-123
P590-BBBcc-123
P520-CCCc-123
P590-DDDccc-123
P550-EEEc-123

That I would like to format the following way

P590-AAAc-123 P590-BBBcc-123 P590-CCCc-123
P590-DDDccc-123 P590-EEEc-123

So far I've got

$SSHU $HMC -l $HMCUSER lssyscfg -r sys | awk -F, '{print $1}'|sed s/^name=//|tr '\n' ','

Which gives me AAA,BBB,CCC,DDD,EEE

Can't for the life of me get it into formatted columns tried /t in the tr but because of the different lengths the columns look a mess.

Ideas anyone?


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."
 
man paste
A starting point:
ls | paste - - -

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Doh!

I was trying to be too clever.

Thanks PHV - must remember not to try scripting after visiting a beer feastival.

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."
 
Nor typing after a bear festival! ;-)

I want to be good, is that not enough?
 
[OT]
It was a long night....
Which will be repeated again tonight.
[/OT]

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