Computing.Net > Forums > Unix > splitting fileds into rows in unix

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

splitting fileds into rows in unix

Reply to Message Icon

Name: gounix
Date: July 3, 2007 at 05:21:43 Pacific
OS: SunOS
CPU/Ram: X
Product: X
Comment:

HI , need your help again

I ahve a file, like below

a,b,c,d

I want this file as
a,
b,
c,
d

Kindly reply if anybody has quicj solution in UNIX.. preferably ksh

Thanks




Sponsored Link
Ads by Google

Response Number 1
Name: ghostdog
Date: July 3, 2007 at 07:01:26 Pacific
Reply:

awk '{gsub(",",",\n")}{print}' file


0

Response Number 2
Name: lankrypt0
Date: July 3, 2007 at 08:55:04 Pacific
Reply:

or
tr "," "\n" < file


0

Response Number 3
Name: ghostdog
Date: July 3, 2007 at 16:36:05 Pacific
Reply:

OP's sample output retains the ",". so tr "," does not really give the correct output.


0

Response Number 4
Name: gounix
Date: July 4, 2007 at 01:48:16 Pacific
Reply:

Thanks guys.. for all your replies


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Scripting -Help needed running unix command in v...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: splitting fileds into rows in unix

FTP in Unix www.computing.net/answers/unix/ftp-in-unix/1828.html

NEED TO PRINT HTML IN UNIX! HELP! www.computing.net/answers/unix/need-to-print-html-in-unix-help/2834.html

deleting rows in a file www.computing.net/answers/unix/deleting-rows-in-a-file/3676.html