unix - How do i change the following input line using SED? -
how change following input line using sed ?
input - bus_ln in ('abc');
required o/p - bus_ln in ('def','xyz');
give try:
sed "s/\([^(]*\)('[^']*')/\1('def','xyz')/" inputfile
it replace whatever between parentheses.
input:
bus_ln in ('abc'); foo('bar'); baz aaa bbb ('ccc ddd') more text
output:
bus_ln in ('def','xyz'); foo('def','xyz'); baz aaa bbb ('def','xyz') more text
Comments
Post a Comment