I'm looking to replace several strings and then write them to a .csv file
Everything works well when I replace a single text, but when wanting to replace 2 or more, I only take the last replacement text, which only allows me to put a string after WriteAllText
.
This is my code:
string reemplazo = "";
string reemplazo2 = "";
string Arch = File.ReadAllText(originalFileName); //Aqui leo mi archivo .csv
reemplazo = Regex.Replace(Arch, @"/", @"/");
reemplazo2 = Regex.Replace(Arch, @"–", @"-");
File.WriteAllText(newFileName.Substring(0, newFileName.Length - 4) + "Test.csv", reemplazo); //solo puedo poner un valor del remplazo
File.Move(originalFileName, newFileName);
files.Add(newFileName);