The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 -->
  #5 (permalink)  
Old 01-28-2008
Karthikeyan_113 Karthikeyan_113 is offline
Registered User
  
 

Join Date: Jan 2007
Location: Boston, USA
Posts: 16
Thumbs up Try this....

Input file:-
$ > cat 123.txt
unixsrv1:unixsrv2:unixsrv3:mercury:mercury01:sunprd01:sunprd02:hpprod07:ibmprod43
$ >

Command:-
$ > cat 123.txt | tr -s ":" "\n" > 123_1.txt
$ >

Output:-
$ > cat 123_1.txt
unixsrv1
unixsrv2
unixsrv3
mercury
mercury01
sunprd01
sunprd02
hpprod07
ibmprod43
$ >

Thanks,
Karthik.