I'm trying to remove the pipe delimiter from double quotes,its replacing with following code but its not handling empty filed and numeric fields. Any help would be appreciated.
Code:
sed 's/|*\([^"]\)/\1/g;s/\([^"]\),*/\1/g' test.csv
INPUT:
"Southern|Palms"|"AA|None"|"4"|"Kenya"|"MBA"|"Ken|Coast"|"Y"|1/11/2019 00:00:00|30/4/2020 00:00:00|"TH"||40.00|"HB|AI"||||||"Y"||||
OUTPUT:
"SouthernPalms"|"AANone"|"4"|"Kenya"|"MBA"|"KenCoast"|"Y"1/11/2019 00:00:0030/4/2020 00:00:00|"TH"40.00|"HBAI"|"Y"|
Expected Output:
"Southern Palms"|"AA None"|"4"|"Kenya"|"MBA"|"Ken Coast"|"Y"|1/11/2019 00:00:00|30/4/2020 00:00:00|"TH"||40.00|"HB AI"||||||"Y"||||