Hi frnds.. Need help in writing a small script...
I have the following text file...
1)PPI2MSNK I5 P50
2) PIAIS Major
3)PPI2MSNK I5 P51
4) PILOS Major
5)PPI2MSNK I5 P57
6) PIAIS Major
7)PPI2MSNK I7 P57
8) PIAIS Major

I want the script to join the line 1-2 , 3-4 , 5-6 , 7-8 .. so on the output should be

PPI2MSNK I5 P50 PIAIS Major
PPI2MSNK I5 P51 PILOS Major
PPI2MSNK I5 P57 PIAIS Major
PPI2MSNK I7 P57 PIAIS Major

Recommended Answers

All 2 Replies

awk '{ a = getline; print $0, a }' file

Thanks Frnd...

Following line has worked...
awk '/^[[:space:]]*$/ {next};{getline X;print $0,X}' "filename"

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.