Jump to content

Using backslash (\) in SED

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
Tor

Tor

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 486 posts
Since this is the escape character how can it be used with SED? I have a line:

data here\ [linebreak]
data here\ [linebreak]

and I need to replace the \ with a new character and the linebreaks with dos line breaks. Any help?

#2
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts
I don't know about SED, but in many other languages you're just "escaping" the escape-character; \\

#3
Tor

Tor

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 486 posts
So I just use it twice? \\

#4
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts
If you want to use \ in a string, then it has to be \\, yes.