4 deleted 247 characters in body
source | link

I have a where clause string in Unix file as below

where c1 in (a) and c2 in (a,b,c) and c3 in ()

Need Output as

where c1 in ('a') and c2 in ('a','b','c') and c3 in ()

Am using sed command as follows

sed -r "s/,([^ ),]+)/,'\1'/g"  <Filename>

But this is giving output as

where c1 in (a) and c2 in (a,'b','c') and c3 in ('')

Single quotes are not being assigned to first string after open braces. WouldWould be great if some one can complete this.

I have a where clause string in Unix file as below

where c1 in (a) and c2 in (a,b,c) and c3 in ()

Need Output as

where c1 in ('a') and c2 in ('a','b','c') and c3 in ()

Am using sed command as follows

sed -r "s/,([^ ),]+)/,'\1'/g"  <Filename>

But this is giving output as

where c1 in (a) and c2 in (a,'b','c') and c3 in ()

Single quotes are not being assigned to first string after open braces. Would be great if some one can complete this.

I have a where clause string in Unix file as below

where c1 in (a) and c2 in (a,b,c) and c3 in ()

Need Output as

where c1 in ('a') and c2 in ('a','b','c') and c3 in ('')

Would be great if some one can complete this.

3 formatting
source | link

I have a where clause string in Unix file as below

where c1 in (a) and c2 in (a,b,c) and c3 in ()

Need Output as

where c1 in ('a') and c2 in ('a','b','c') and c3 in ()

Am using SEDsed command as follows

sed -r "s/,([^ ),]+)/,'\1'/g"  <Filename>

But this is giving output as

where c1 in (a) and c2 in (a,'b','c') and c3 in ()

Single quotes are not being assigned to first string after open braces. Would be great if some one can complete this. Thanks in advance.

I have a where clause string in Unix file as below

where c1 in (a) and c2 in (a,b,c) and c3 in ()

Need Output as

where c1 in ('a') and c2 in ('a','b','c') and c3 in ()

Am using SED command as follows

sed -r "s/,([^ ),]+)/,'\1'/g"  <Filename>

But this is giving output as

where c1 in (a) and c2 in (a,'b','c') and c3 in ()

Single quotes are not being assigned to first string after open braces. Would be great if some one can complete this. Thanks in advance.

I have a where clause string in Unix file as below

where c1 in (a) and c2 in (a,b,c) and c3 in ()

Need Output as

where c1 in ('a') and c2 in ('a','b','c') and c3 in ()

Am using sed command as follows

sed -r "s/,([^ ),]+)/,'\1'/g"  <Filename>

But this is giving output as

where c1 in (a) and c2 in (a,'b','c') and c3 in ()

Single quotes are not being assigned to first string after open braces. Would be great if some one can complete this.

2 added 22 characters in body
source | link

Need to insert Insert single quotes in text file for use as SQL query that follows the open-parens using sed

I have a wherewhere clause string in Unix file as below where c1 in (a) and c2 in (a,b,c) and c3 in ()

where c1 in (a) and c2 in (a,b,c) and c3 in ()

Need Output as
where c1 in ('a') and c2 in ('a','b','c') and c3 in ()

where c1 in ('a') and c2 in ('a','b','c') and c3 in ()

Am using SED command as follows sed -r "s/,([^ ),]+)/,'\1'/g" .

sed -r "s/,([^ ),]+)/,'\1'/g"  <Filename>

But this is giving output as where c1 in (a) and c2 in (a,'b','c') and c3 in ().

where c1 in (a) and c2 in (a,'b','c') and c3 in ()

Single quotes are not being assigned to first string after open braces.

Would Would be great if some one can complete this. Thanks in advance.

Need to insert single quotes in text file for use as SQL query that follows the open-parens using sed

I have a where clause string in Unix file as below where c1 in (a) and c2 in (a,b,c) and c3 in ()

Need Output as
where c1 in ('a') and c2 in ('a','b','c') and c3 in ()

Am using SED command as follows sed -r "s/,([^ ),]+)/,'\1'/g" . But this is giving output as where c1 in (a) and c2 in (a,'b','c') and c3 in (). Single quotes are not being assigned to first string after open braces.

Would be great if some one can complete this. Thanks in advance.

Insert single quotes in text file for use as SQL query that follows the open-parens using sed

I have a where clause string in Unix file as below

where c1 in (a) and c2 in (a,b,c) and c3 in ()

Need Output as

where c1 in ('a') and c2 in ('a','b','c') and c3 in ()

Am using SED command as follows

sed -r "s/,([^ ),]+)/,'\1'/g"  <Filename>

But this is giving output as

where c1 in (a) and c2 in (a,'b','c') and c3 in ()

Single quotes are not being assigned to first string after open braces. Would be great if some one can complete this. Thanks in advance.

1
source | link