I have input files that are CSV format, created in another program. I have no control over them. I'm finding that with those files, line feed characters within doublequotes are incorectly treated as new rows.
If I recreate the file myself, it works correctly. I see no difference between the two files (the one I created and the one created by the other system) in Notepad. In all cases, the line feed characters are ascii 10 and the doublequote characters are ascii 34.
In notepad, the files both look like this:
Field1,"Field2a
Field2b",Field3
In the file I created, when I open it as a CSV in Excel, Cell B1 looks like this. This is correct; the line feed character within the doublequotes is treated as a literal, not as a new row.
But in the file from the other system, even though it looks exactly the same in Notepad and the line feed character is the same ascii 10 and the doublequote characters are the same ascii 34, when I open it as a CSV in Excel, Cell B1 looks like this. The line feed character, though it is within doublequote characters, is incorrectly treated as indicating a new row::
Unfortunately I'm not able to upload the files here as far as I understand.
Any suggestions?
I'm using Excel 2021.
UPDATE:
I was asked to view them in Notepad++>View>Show Symbol>Show All Characters. I downloaded Notepad++ and viewed them like that; they look the same there too:
UPDATE 2:
I installed the Notepad++ Compare plugin. When I used it to compare, it said this:
I clicked Yes to compare anyway, and it said this:
So it seems there is some difference in the files but in their content?
UPDATE 3:
I was asked about the encoding shown in the lower-right corner of the Notepad++ window.
- The one that works correctly is UTF-8.
- The one with the problem is UTF-8-BOM.
Any suggestions on what I can do about this? Again I have no control over these input files.





