I have problem with some corrupt csv-File. I get it like that:
column1,column2,column3,column4,column5,column6
123,"some text",""column3 text"",""still column3 text"",4,234,""
123,"some text",""column3 text"",4,234,""
In table it should look like that:
column1 | column2 | column3 | column4 | column5 | column6
123 | some text | "column3 text, still column3 text" | 4 | 234 |
123 | some text | "column3 text" | 4 | 234 |
I am reading the file with php and tried to use it with str_getcsv into array. But because of this broken quotes it won't work and always have more columns than titles.
At all I don't need value of column 3 so I tried to do some regex to make three groups and do preg_replace then. But I don't get a regex that works for both lines.
With this regex I get just first line: https://regex101.com/r/OjTAAC/1
and with this I get just second line: https://regex101.com/r/I2xqPs/1
Anybody has some help how to get a regex that works for both situations?