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

In CSV import dialog, add option to treat values with leading zeros as text #33429

Closed
davidlgalt opened this issue Dec 16, 2019 · 2 comments
Closed

Comments

@davidlgalt
Copy link

davidlgalt commented Dec 16, 2019

I work with a number of datasets that have code fields in them. The values often only contain numbers with one or more of the first digits as zeros. If the import dialog for CSV files had a checkbox (boolean) to treat fields with leading zeros as text then these fields would be able to be correctly imported.

The algorithm would iterate through all the values and would detect occurrences where the first position was 0 but the second position was not a decimal character. If any of these occurred then the field would be imported as text, even if all values contained only numbers and decimal characters.

@i-s-o
Copy link
Contributor

i-s-o commented Dec 16, 2019

I find declaring the field types (in .csvt/.tsvt files) very useful: no guessing = no unexpected results!
See: https://gdal.org/drivers/vector/csv.html

To test, drag and drop the following (as a zip file) onto QGIS:
test.zip

My experience with "Add Delimited Text Layer" is less than ideal.

@alexbruy
Copy link
Contributor

alexbruy commented May 1, 2020

Duplicates #21113.

@alexbruy alexbruy closed this as completed May 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants