CodableCSV icon indicating copy to clipboard operation
CodableCSV copied to clipboard

Last column decodes as blank

Open joshdistler opened this issue 3 years ago • 1 comments

Question Hi all. Not sure if this is pilot error or if its a bug but it appears that the last column in our CSV consistently decodes to blank. We've got a correct header line and I'm using a .firstLine strategy. Have also confirmed that my data model has the same number of columns as vars. The only solution to fix this appears to be using a dummy column at the end.

System OS: macOS 12.3.1, Xcode 12.3 CodableCSV 0.6.7

joshdistler avatar Apr 04 '22 16:04 joshdistler

Ran into something similar - for me, I was able to fix it by doing a .replacingOccurrences(of: "\r\n", with: "\n") on the input string before passing it to the decoder. (Potentially could also be resolved by switching the delimiter.row to \r\n instead of the. default, but I wanted to support either type of input.)

grey280 avatar Nov 23 '23 18:11 grey280