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

CSV: Add option to skip invalid rows #959

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Jofkos
Copy link

@Jofkos Jofkos commented Apr 1, 2024

CSV files may contain invalid rows (i.e., rows that have the wrong number of columns). In some cases, those are not expected and thus not loading the entire file (and displaying a warning) may make sense. This is what is currently done. In other cases, however, due to how the CSV files are generated, invalid rows may be expected and still being able to load such a file without having to first manually remove them would thus be helpful.

This pull request does exactly that: It adds a checkbox to just ignore rows which don't have as many values as there are columns. It is unchecked by default, preserving the current behaviour.

Screenshot 2024-04-01 at 16 26 57

@Jofkos Jofkos changed the title CSV: added option to skip invalid rows CSV: Add option to skip invalid rows Apr 1, 2024
@facontidavide
Copy link
Owner

I wonder who wants to load a corrupted CSV...

@Jofkos
Copy link
Author

Jofkos commented Apr 22, 2024

I made that change because it is useful.

Here's one use-case: A CSV gets written to by an application which is connected to a physical instrument. You don't want to stop the experiment, but want to quickly inspect the data as it is running. When you grab the CSV file, the last line is incomplete. Sure, this is not a problem: just delete the last line. When you have to do this multiple times a day, having the ability to just drag in the files rather than having to open them in a separate application first is a big win.

Here's another one: Some process may just generate CSV where some lines are incomplete. This could be because of fickle communication, interference or a non-prioritized telemetry printing being interrupted improperly. Just because that's the case, does that mean the telemetry that does get through is worthless?

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

Successfully merging this pull request may close these issues.

None yet

2 participants