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

Ignore empty lines #115

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Ignore empty lines #115

wants to merge 2 commits into from

Conversation

mslw
Copy link
Contributor

@mslw mslw commented Nov 21, 2023

This PR resolves #110

  • datalad_tabby.io.xlsx.xlsx2tabby will trim blank rows sometimes found at the end of a spreadsheet
  • datalad_tabby.io.load_tabby will treat empty strings as no value when detecting empty rows to be ignored
  • one test tsv tabby file has empty lines at the end removed, to ensure round-tripping with the changes above

mslw added 2 commits November 21, 2023 14:19
This will do a better job of ignoring empty tsv lines, bu checking for
empty strings in addition to Nones (I think csv reader typically
produces empty strings).
With this change, excel to tabby conversion will preserve empty lines
in the middle of the file (maybe a visual separation of sections in a
many-objects file), but truncate empty lines at the end (maybe excel
artefact). This requires double iteration over the rows (first to find
where data ends, then to export), but it seems inexpensive.

This should help situations when excel (or calc) xlsx file preserves
blank lines.

One test data file (tsv) used to test round-tripping is altered to
remove empty lines at the end. So in the end we no longer guarantee
round-tripping these empty lines, but I feel this was a non-feature.
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.

Remove empty lines in xlsx2tabby
1 participant