Link to home
Start Free TrialLog in
Avatar of alexgor
alexgor

asked on

Regular Expression (sed editor)

Hello !

I have following file, called for example "a.txt"

f_a
m_b

Now I want to replace each first character at a line followed by "_", by the same character followed by "@",
in other words I wish to receive following file.

f@a
m@b

It's important for me to execute the upper task using sed editor, and I do it in the following way:

>> sed s/"^(.)_"/"\0@"/ a.txt > b.txt

But for any reason this command doesn't work.

Can you please explain what is a problem.

Txs,
Alex

ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany 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
Avatar of alexgor
alexgor

ASKER

Thank you very much.