-
-
Notifications
You must be signed in to change notification settings - Fork 281
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
Fixed width saver and loader don't round trip. (Columns expand with increasing number of spaces) #2255
Comments
Most recent fixed width saver issue: #1849 |
Are you suggesting the issues are related? On reflection, I suspect there are two issues here:
1. Either the saver needs to only include a single space between columns, or the loader needs to strip multiple spaces around columns.
2. ~~The column headers of right aligned columns should also be right aligned? Maybe? Having second thoughts on that.~~ EDIT: Pretty sure we don't want to do this.
|
Hmm... I'm wondering if Line 472 in 6424f63
|
I've added a draft PR with some experimentation. (#2257) It's a lot closer to what I expect. It separates columns by a single space. However, when reading, that space is still interpreted as data, so we still grow by a single space per round trip. I think the saver is good to go, but the loader needs some work to prevent it loading the column separation space as data. I also switched it to use the real max width, rather than the max width of the window. This will be slow, but I think it's OK, because it will only run when saving, and I think most people would want to save all the data without truncating it. |
Don't add so many spaces between columns. Use the max width of the data, rather than the max width of the window.
The PR above is ready for initial review. |
Don't add so many spaces between columns. Use the max width of the data, rather than the max width of the window.
Don't add so many spaces between columns. Use the max width of the data, rather than the max width of the window.
Small description
Open
test.csv
:Then save it as
test.fixed
:Each column is separated by three spaces.
Now, open the newly saved
test.fixed
, and save it astest.fixed.csv
.Upon inspection, you will see that the three spaces have been included as column data, rather than being discarded as a separator:
If you repeat this process, three spaces get appended to each column every time you repeat a round trip.
Expected result
I expect to be able to round trip from CSV to Fixed and back without extra spaces being added to the data.
Steps to reproduce with sample data and a .vd
test-fixed-saver.zip
Additional context
The text was updated successfully, but these errors were encountered: