o2r-project / geoextent

Python library for extrating geospatial extent of files and directories with multiple data formats
https://o2r.info/geoextent/
MIT License
1 stars 4 forks source link

Handling CSV files separated by either semicolon or comma #34

Closed YouQam closed 4 years ago

YouQam commented 4 years ago

Now the default is separated by comma and doesn't work when separated by semicolon.

Adding delimiter with semicolon makes doesn't work when separated by comma.

daten = csv.reader(csv_file.readlines(), delimiter=';')

The solution can be using pandas, where mutliple delimiters can be added,

nuest commented 4 years ago

Adding delimiter with semicolon makes doesn't work when separated by comma.

Than can be expected.

We don't need to support multiple delimiters in the same file. I suggest instead to look in the first line of the CSV file and then use the first delimiter that appears on it as a simple detection method. That should work in most cases!

YouQam commented 4 years ago

I solved the issue using delimiters detection,