![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Newlines in shell variables | narcvs | Shell Programming and Scripting | 5 | 03-26-2009 02:54 AM |
| textfile into 2 pieces, seperate by newlines. | mcW | Shell Programming and Scripting | 12 | 09-24-2008 04:02 PM |
| replacing using sed | shailesh_arya | Shell Programming and Scripting | 2 | 07-11-2008 01:06 AM |
| Bash scripting question re: newlines | retrovertigo | Shell Programming and Scripting | 4 | 07-06-2007 01:44 PM |
| Counting characters between comma's | dbrundrett | Shell Programming and Scripting | 2 | 03-19-2004 09:56 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
replacing comma's with newlines using sed
Hi All,
silly question that I'm sure is easy to answer for a more experienced coder... I have a file called test.txt containing the following text... need, to, break, this, line, into, individual, lines using sed, I'd like to make the file look like this... need to break this line into individual lines here's the code I've tried #!/bin/ksh sed "s/,/\n/" test.txt > test.new.txt but it returns the following in test.new.txt Addn this, line, after, every, line, with, WORD so, my questions are... 1.) how can I make sed replace all instances of "," in a given line? 2.) how can I make sed insert newline characters instead of just the character n? Thanks in advance! |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|