1835253 Members
2143 Online
110078 Solutions
New Discussion

Re: Quick fix

 
SOLVED
Go to solution
KapilRaj
Honored Contributor

Quick fix

Guys,

Please give me a quick fix for this trouble.

I have a text file which has 6,5 or 1 columns delimited by a space.

Yea u guess it right , It is a simple df o/p from a linux box. What i need is each filesystem in a single line.

So i tried ,

cat |awk '{if (NF==6) print $0;else printf $0;getline;print $0}'

It gives me some error's ... i hope u guys don't need it as the syntax itself looks bad.

Could you please correct me?

Regds,

Kaps
Nothing is impossible
3 REPLIES 3
Fred Ruffet
Honored Contributor
Solution

Re: Quick fix

Kapil,

Something strange for me : output is always on one line... but I had to deal with this on HP before, and so I used a script I post on this thread :
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=51050
(search for my name and it should be ok)
It is for HP's bdf, but you should find your way

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
KapilRaj
Honored Contributor

Re: Quick fix

Cool.... Thats it !!

Regds,

Kaps
Nothing is impossible
KapilRaj
Honored Contributor

Re: Quick fix

closing it
Nothing is impossible