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

Problem reading .csv header #390

Closed
jkoschinsky opened this issue Apr 6, 2016 · 8 comments
Closed

Problem reading .csv header #390

jkoschinsky opened this issue Apr 6, 2016 · 8 comments

Comments

@jkoschinsky
Copy link
Collaborator

GeoDa 1.7.103 (OSX Yosemite, 10.10.5)

I read this test csv into GeoDa, where one of the variable names consists of numbers only. In this case, GeoDa doesn't recognize the first row as a header row and instead adds automatic field names and an extra first row.

Question is if it possible to still recognize the header row for cases like this.

Here's the test file:
test2.csv.zip

@lixun910
Copy link
Member

lixun910 commented Apr 6, 2016

That’s how OGR behaves. The fix is easy as just rename the field name from a pure number to something starts with a letter. We can add a dialog to let user choose which row is field name, even the field type (like excel). Then create a csvt file for OGR reading. However, it will take some time. Let me know if you want this feature in current release.

On Apr 6, 2016, at 1:53 PM, jkoschinsky [email protected] wrote:

GeoDa 1.7.103 (OSX Yosemite, 10.10.5)

I read this test csv into GeoDa, where one of the variable names consists of numbers only. In this case, GeoDa doesn't recognize the first row as a header row and instead adds automatic field names and an extra first row.

Question is if it possible to still recognize the header row for cases like this.

Here's the test file:
test2.csv.zip https://github.com/lixun910/geoda/files/207325/test2.csv.zip

You are receiving this because you were assigned.
Reply to this email directly or view it on GitHub lixun910#390

@jkoschinsky
Copy link
Collaborator Author

I would log it for the future since it's more of an edge case.

On 6 April 2016 at 13:57, Xun Li [email protected] wrote:

That’s how OGR behaves. The fix is easy as just rename the field name from
a pure number to something starts with a letter. We can add a dialog to let
user choose which row is field name, even the field type (like excel). Then
create a csvt file for OGR reading. However, it will take some time. Let me
know if you want this feature in current release.

On Apr 6, 2016, at 1:53 PM, jkoschinsky [email protected]
wrote:

GeoDa 1.7.103 (OSX Yosemite, 10.10.5)

I read this test csv into GeoDa, where one of the variable names
consists of numbers only. In this case, GeoDa doesn't recognize the first
row as a header row and instead adds automatic field names and an extra
first row.

Question is if it possible to still recognize the header row for cases
like this.

Here's the test file:
test2.csv.zip <
https://github.com/lixun910/geoda/files/207325/test2.csv.zip>

You are receiving this because you were assigned.
Reply to this email directly or view it on GitHub <
https://github.com/lixun910/geoda/issues/390>


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
lixun910#390 (comment)


Julia Koschinsky, Ph.D.
Research Director
Associate Research Professor
Arizona State University
School of Geographical Sciences and Urban Planning
GeoDa Center for Geospatial Analysis and Computation
[email protected]

http://geodacenter.asu.edu
http://www.facebook.com/geodacenter
http://twitter.com/GeoDaCenter

@lixun910
Copy link
Member

same issue as #459

@jkoschinsky
Copy link
Collaborator Author

GeoDa 1.8.13.5, OSX

It loads correctly now but replaces all field names to field_1, field_2 etc. (see below). If someone has lots of variables with one that has a numeric name, then renaming all is really frustrating.

Is it possible to only rename the numeric one instead of resetting all?

screen shot 2016-09-15 at 10 41 43 am

screen shot 2016-09-15 at 10 41 52 am

@lixun910
Copy link
Member

This is a special case that first row has an integer number as field name, so OGR treats the first line as data not header (field names).

Will add an checkbox option in the dialog to allow user specify first row is data or header.

On Sep 15, 2016, at 10:44 AM, jkoschinsky [email protected] wrote:

GeoDa 1.8.13.5, OSX

It loads correctly now but replaces all field names to field_1, field_2 etc. (see below). If someone has lots of variables with one that has a numeric name, then renaming all is really frustrating.

Is it possible to only rename the numeric one instead of resetting all?


You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or mute the thread.

@lixun910
Copy link
Member

GeoDa will automatically detect header, and separator.

@jkoschinsky
Copy link
Collaborator Author

GeoDa 1.8.15.5 — Mac OSX

problem persists with these two test cases:
test.zip

lixun910 referenced this issue in lixun910/geoda Jan 7, 2017
#532 Text for CSV input
#520 Add option to specify lat/lon columns in csv file
#390 Problem reading .csv header
#510 Real-to-integer conversion bug in initial csv dialog
lixun910 referenced this issue in lixun910/geoda Jan 9, 2017
@jkoschinsky
Copy link
Collaborator Author

GeoDa 1.8.15.9 — Mac OSX
Confirmed fix:

screen shot 2017-01-13 at 6 20 36 am

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

2 participants