I have a CSV file that contains several lines like this one :
"bar","foo, bar","18","07/09/2012 02:08:16","payments, recent","payments, all"
Some values contain commas, and I need to remove these commas in order to obtain this result :
"bar","foo bar","18","07/09/2012 02:08:16","payments recent","payments all"
I started with this regex "^(\".+\"\\,?)+$"
but it becomes too much complicated for me.
The final goal is to split that string :
string content = reader.ReadToEnd();
string[] lignes = contenu.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
for (int i = 1; i < lignes.Length; i++)
{
// REMOVE COMMAS
string[] values = csv.Split(new[] {','});
// do something
}
reader.Close();
Thanks.