in reply to remove a comma
You could also try fixing on a later step. Put the following small Perl script into chop-sql-comma.pl:
my $sql = do {local $/; <>}; $sql =~ s/\( ([^()]+) \) , \n\)/($1)\n)/x; print $sql;
Then run from a command prompt with perl "edit in place" mode:
C:\Users\...>perl -i.bak chop-sql-comma.pl CUSTOMER_NEW.txt
Update - after some more digging golfed to (again windows cmd prompt):
perl -Mv5.14.0 -i.bak -e^ "local $/;print <> =~ s/\( ([^()]+) \) , \n\)/($1)\n)/xr"^ CUSTOMER_NEW.txt
Ron
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: remove a comma
by luupski (Initiate) on Jun 23, 2018 at 05:21 UTC |
In Section
Seekers of Perl Wisdom