Hi,
How to replace any character in a file with a newline character using sed ..
Ex:
To replace ',' with newline
Input:
abcd,efgh,ijkl,mnop
Output:
abcd
efgh
ijkl
mnop
Thnx in advance.
Regards,
Sasidhar
Hi,
How to replace any character in a file with a newline character using sed ..
Ex:
To replace ',' with newline
Input:
abcd,efgh,ijkl,mnop
Output:
abcd
efgh
ijkl
mnop
Thnx in advance.
Regards,
Sasidhar
sed s/,/\\n/g file1
Hi Prajith,
Its not working...
the o/p is something like this
abcdnefghn ...
notice that 2 slashes before 'n'
its
sed s/,/\\n/g file1
NOT
sed s/,/\n/g file1
sed 's/,/\
/g' _somefile > some_new file
** yes it should be split into two lines like this
try this
tr "," "\n" <input_file> Output