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

Popular posts from this blog

python - Does anyone know how to configure the hunpos wrapper class on nltk? -

mod rewrite - Doing external redirect. .htaccess NS flag not working. How to achieve similar results? -