I use a OleDb data reader to read a number of records, and then write them to a CSV. I then read from this CSV using File.ReadAllLines
, then split on commas to get my data. The problem is some parts of the CSV include a character I can't display (shows up as a square), which appears to act as a line break - this line break corrupts the CSV, so I need to get rid of it.
I've tried replacing Environment.NewLine
with something else (a blank space) when writing the CSV, and ditto with /r
and /n
but to no avail - the character isn't replaced. What other ways are there to remove these?