Carey Brown wrote:Have you tried adding the Charset parameter to Files.lines() ?
What if the order of Lee and Kim are swapped in this file ?
Ron McLeod wrote:File contents:
Carey Brown wrote:What if the order of Lee and Kim are swapped in this file ?
Missing ending CR/LF.
Ron McLeod wrote:Interesting - if I reverse the two entries in the file, the map lookups fail. ???
Carey Brown wrote:Missing ending CR/LF.
Carey Brown wrote:A CSV file should NOT have a BOM. I've convinced myself that that's the main issue.
Al Hobbs wrote:The file I was using was saved in UTF-8 using notepad. So the fix is to remove the initial BOM?
Tim Holloway wrote:my Humble Opinion is that any stream reading that sees Byte Order Markers as something to explicitly pass on isn't properly operating as a text reader, it's operating in raw mode and therefore not the proper choice.
Ron McLeod wrote:Notepad++ lets you save with or without BOM.