Because meantime i wrote an answer to the question, what got closed - trying to reword and re-ask it.
Having an CSV file with 180 milions records, with 5 columns as:
"c a","L G-3 (8) N (4th G P Q C- 4 R- 1 T H- 15.6 I- W 8.1) (B)","C & P_L",1,0
How to change it to the 3 column structure as:
"c a|L G-3 (8) N (4th G P Q C- 4 R- 1 T H- 15.6 I- W 8.1) (B)|C & P_L",1,0
e.g. need concatenate the colums 1,2,3 with |
and print it as one column and leave other colums unchanged
Tried it with regexes:
cat RelatedKW.csv | perl -pe 's/(\|)/\//g'| perl -pe 's/("\s*"|"\s*"\s*\\n$)//g'| perl -pe 's/^,"|,,|"\s*,\s*\"/|/g' | perl -pe 's/\"(\d+),(\d+)\"/ |$1|$2/g' > newRKW4.csv`
Is here any better way?