Need a Command To display "echo command value in loop" in single line.

Hi
I want to display "echo command value in loop" in single line. My requirement is to show the input file (test_1.txt) like the output file (test_2.txt) given below.

Input file :test_1.txt
a1|b1|4|5
a1|b1|42|9
a2|b2|32|25
a1|b1|2|5
a3|b3|4|8
a2|b2|14|6

Output file:test_2.txt
a1|b1|4|5|42|9|2|5
a2|b2|32|25|14|6
a3|b3|4|8

The Highlightened same color values which come after "a" and "b" comes in same row in out put file.

Tq
Sakthifire

Use nawk or /usr/xpg4/bin/awk on Solaris.

awk -F"|" '{a[$1$2]=a[$1$2]?a[$1$2] FS $3 FS $4:a[$1$2]=$0}
END{for(i in a)print a}
' test_1.txt > test_2.txt

Regards

Awesome ... Great ... in Span of 10 mins you found it .

Thank you a lot ...

Regards
Sakthifire