The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 12-23-2005
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,798

Code:
[/tmp]$ echo "10
AAA;
200
BBB;
3
CCC;" | sed -e '/.*[^;]$/{
N
s/\(.*\)\n\(.*;$\)/\1 \2/
}'
10 AAA;
200 BBB;
3 CCC;


Last edited by vino; 12-23-2005 at 05:40 AM..