I have a csv file which I want to strip out the " quotes. The problem is that some of the fields have , in the middle of them e.g. 3 fields:
"intel","fast, expensive","$45"
when I replace s/"//g I end up with 4 fields:
intel,fast, expensive,$45
I guess I need to strip out the first " on the first char of a row, then any s/",// then s/,"// then the physical last " on the row.
Is this the right way? how do I detect the first and last "
Another way I was thinking of is to change all the , which are not surrounded by " with a ; so I then get:
"intel";"fast, expensive";"$45"
and then I can just do a s/"//g to get
intel;fast, expensive;$45
Cheers.
"intel","fast, expensive","$45"
when I replace s/"//g I end up with 4 fields:
intel,fast, expensive,$45
I guess I need to strip out the first " on the first char of a row, then any s/",// then s/,"// then the physical last " on the row.
Is this the right way? how do I detect the first and last "
Another way I was thinking of is to change all the , which are not surrounded by " with a ; so I then get:
"intel";"fast, expensive";"$45"
and then I can just do a s/"//g to get
intel;fast, expensive;$45
Cheers.