question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

parsing error when last column is empty

See original GitHub issue

hello I have a file where a small number of records are “missing” a value in the last column. The file is tab delimited and the last tab is there but the parser still gives an error. For example abc\ t0.00 \t 0.00 \t 0.00 \t 0.00 \t 0.00 \t 0.00 \t 0.00 \t 0.00 \t 0.00 \t (I added spaces to be a little clearer).

Most of the time the last column has a value (xx or yy) but in these (valid) cases the value is an empty string. Is there a configuration option of this scenario or do I need to do via pre-processing or custom tokenizer? I hate to do this for such a small population of records but the empty string is valid.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9

github_iconTop GitHub Comments

1reaction
stevengopmocommented, Jan 28, 2019

actually I figured this out. I had the following as my settings

var tokenizer = new StringSplitTokenizer(new[] { Delimiter }, trimLine: true);

changing trimLine to false fixed it

0reactions
bytefishcommented, Feb 7, 2019

Great! Thanks for the feedback. 🙃

Read more comments on GitHub >

github_iconTop Results From Across the Web

c++ parsing through csv file and last column
What seems to happen is if the last column is empty, it either skips it or give incorrect data (not really sure yet)....
Read more >
parsing error when last column is empty · Issue #34
hello I have a file where a small number of records are "missing" a value in the last column. The file is tab...
Read more >
Retrieving the last column in empty SQLite database ...
I have made an SQLite database with 15 columns and default values of NULL. I am retrieving all 15 columns from the SQLite...
Read more >
Unable to do a Date parse for a Null Column
Hi Friends, I am having a Scenario having some null columns in the date field. When i try to parse it, i get...
Read more >
Parsing errors with read_csv - tidyverse
Hello, I'm new to R and I'm trying to use the read_csv function. However it gives me parsing errors. I did use the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found