hopefully an easy perl script?

hatch coltraine

New member
background info - I am writing a shell script that is to build a sql script based on certain parameters.


INPUT:
and to_number(substr(ID,1,9)) in (
009645316,
343740992,
400292219,
407335191,
409457202,
413510212,
415638303,
)



output:

and to_number(substr(ID,1,9)) in (
009645316,
343740992,
400292219,
407335191,
409457202,
413510212,
415638303
)


The perl command I'm attempting to use is:
perl -ne 'BEGIN{undef $/} s#\,\n\)"#\)"#g; print' query1.sql > query2.sql

but query2.sql comes out with the comma still at the end.

Any ideas? Thanks in advance!
 
Back
Top