Link to home
Start Free TrialLog in
Avatar of modsiw
modsiw

asked on

sed - replace backslash linefeed with backslash

sed 's/\\\n/\\/g' doesn't work. What should it be?
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

what do you get when you run command?

try

sed 's/\\n/\/g'
Avatar of modsiw
modsiw

ASKER

My command doesn't modify the file at all.

Yours doesn't work; blackslash must be escaped.
Avatar of modsiw

ASKER

sed 's/\n//g'

doesn't do anything either. I'd expect it to turn the file into a single long line
I'd use tr instead

tr -d '\n' <file

Open in new window


sed ':L;$!N;s/\n/\\/g;tL'

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Maciej S
Maciej S
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial