Vikas Negi

Vikas Negi

  • NA
  • 6
  • 973

replace double quotes with single quotes in a csv file.

Sep 21 2018 3:48 AM
Hi Folks ,
 
I have a request where we need to SFTP a CSV file after upting it. This CSV file consists of a column having XML data. This XML data is to be updated as below:
 
creating tags which works fine.but not able to replace " with '. Also "\"" splits the XML data.
 
if (line.Contains("<"))
{
line = line.Replace("&lt;", "<");
}
if (line.Contains("&gt;"))
{
line = line.Replace("&gt;", ">");
}
if (line.Contains("\""))
{
line = line.Replace("\"", "\'"); (this wont work)
}
 
Can anybody help

Answers (2)