1

I have below text in a file. need to replace / to ;:

CREATE SEQUENCE AAA

  /

please not that there is space present in front of /. it needs to be converted as

CREATE SEQUENCE AAA

  ;
  • 4
    sed 's:/:;:' filename? – muru Oct 13 '16 at 11:13
3

You just escape the /

sed 's/\//;/' file

Add -i to modify the file in place

sed -i 's/\//;/' file

Or use a different separator as in comment by Muru

| improve this answer | |
  • it is not working since / has extra space in front. – asalthangam Oct 13 '16 at 12:35
  • Working here regardless of space @asalthangam what is happening for you exactly? – Zanna Oct 13 '16 at 12:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.