replace '"|\n" with new line in shell script

Hi All,

How can i replace '"|\n" with new line in shell script?

Thanks!

vaskar

you can use sed for it..
but with what you wanna replace |\n??

try this:

echo "|\n" | tr '|\n' '\n'

vidya#>sed 's/\|
>/
>/g' filename

Hi,

I have a file like these format

733961132847|COM|0|0|BD|R|79.95

733961134346|COM|0|0|BD|R|34.95

807280134490|COM|0|0|BD|R|39.99

794051400123|COM|36|0|BD|R|99.98

794051415622|COM|5|0|BD|R|28.99

883929004676|COM|10|0|BD|R|28.99

883929017164|COM|5|0|BD|R|39.99

883929024087|COM|3|0|BD|R|99.98

883929026050|COM|8|0|BD|R|39.99

883929026340|COM|3|0|BD|R|179.98

but i have to make it like the format

733961132847|COM|0|0|BD|R|79.95|

733961134346|COM|0|0|BD|R|34.95|

807280134490|COM|0|0|BD|R|39.99|

794051400123|COM|36|0|BD|R|99.98
|
794051415622|COM|5|0|BD|R|28.99|

883929004676|COM|10|0|BD|R|28.99
|
883929017164|COM|5|0|BD|R|39.99|

883929024087|COM|3|0|BD|R|99.98|

883929026050|COM|8|0|BD|R|39.99|

883929026340|COM|3|0|BD|R|179.98|

pls help me.

do you wanna add "|" at the end of each line or whats the criteria??

add "|" at the end of each line...

awk '{printf $0"|"}' filename

sed -e 's/$/\|/g' filename