Hi All,
I'm unable to load the data using sql loader where there are double quotes within the double quotes As these are optionally enclosed by double quotes.
Sample Data :
"221100",138.00,"D","0019/1477","44012075","49938","49938/15043000","Television - 22" Refurbished - Airwave","Supply of Delivery & Collection 1st Unit (1), Delivery & Collection Additions (1), Whitbread Refurb LCD (2)","Airwave Europe Ltd","15/04/2015","2520",""
Desired output :
"221100",138.00,"D","0019/1477","44012075","49938","49938/15043000","Television - 22 Refurbished - Airwave","Supply of Delivery & Collection 1st Unit (1), Delivery & Collection Additions (1), Whitbread Refurb LCD (2)","Airwave Europe Ltd","15/04/2015","2520",""
I have checked for many threads posted in this site. and tried
sed 's/\([^",]\)"\([^",]\)/\1\2/' < infile > outfile
perl -anle 'my @fields = ($_ =~ /(?:^|,)(".*?"|[^,]*?)(?=,|$)/g);foreach my $f(@fields){$f=~s/"//g;$f=sprintf("\"%s\"",$f);}my $line=join(",",@fields);print $line' file
But it didn't work. If the last column of the data is blank. then it is changing for that as well and getting the below output.
"221100",138.00,"D","0019/1477","44012075","49938","49938/15043000","Television - 22 Refurbished - Airwave","Supply of Delivery & Collection 1st Unit (1), Delivery & Collection Additions (1), Whitbread Refurb LCD (2)","Airwave Europe Ltd","15/04/2015","2520","
Could anyone help me out to fix this issue.
Regards,
Lavanya.