I have a data set like below:
\"XXX \ START sapiodj \\" aj \d 2387 END hddo\" START bbcc \\" END ss
My Requirement:
I want to remove all occurrences of backslash\
and double quotes "
between START and END.
Desired Output:
\"XXX \ START sapiodj aj d 2387 END hddo\" START bbcc END ss
Note:
- Multiple START/END in same line
- I want to remove
\
and"
only between START and END and nowhere else - And my file has multiple line (lines similar to what is shown above)
- I have to use
sed
only
I tried something like below (was trying to get rid of "
alone first) and it didn't give me the desired result:
sed '/START/,/END/ s/"//g'
Best Answer
Assuming you don't have
`
character in the file. If you do just change in the line bellow all`
to any other character that for sure will not be present in the input.