Hi,
I fail removing some carriage return, (\n\r i guess) from a god file which brings that the software where i'm exporting to is crying..
if i manually remove the CR from notepad, no problem
i'm googling around for nearly 3 hours now on every possible way i can imagine express this but no luck
my idea is to seek to the end of the file and then to make some substring..but no way
so here's my file :
FileStream fs = new FileStream(@"C:\Users\me\Desktop\output2.csv", FileMode.Append, FileAccess.Write);
StreamWriter sw = new StreamWriter(fs);
but now i don't see any kind of subst or trim methods ?!?!?!?!?
or if i try to read it with :
StreamReader sr = new StreamReader(@"C:\Users\me\Desktop\output2.csv"))
{
char[] c = null;
while (sr.Peek() >= 0)
{
c = new char[2048];
sr.Read(c, 0, c.Length);
}
}
by adding a breakpoint on the sr.Read(), I can see that the 2 last char's filed are '\n' and '\r'..
but, for godsake how can i delete them ?
please someone..for our planet..before i throw my laptop out of this window