Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last column decodes as blank #49

Open
joshdistler opened this issue Apr 4, 2022 · 1 comment
Open

Last column decodes as blank #49

joshdistler opened this issue Apr 4, 2022 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@joshdistler
Copy link

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 joshdistler added the question Further information is requested label Apr 4, 2022
@grey280
Copy link

grey280 commented Nov 23, 2023

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants