Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am trying to import a csv or dbf into qGIS so I can perform a join on a shapefile. However, qGIS is not detecting the first row as header names. I know I've done similar joins before and there's never been a problem detecting column headers. Any help would be much appreciated. Thanks.

share|improve this question
    
please share the first few lines of your CSV –  underdark Feb 13 '13 at 18:57
    
Perhaps special characters in the column name? –  Brad Nesom Feb 14 '13 at 3:16
    
I've tried saving the file as a .dbf in Open Office, but it too is not seeing the intended column names and instead creating a new row of column names. The data looks like this in Open Office: N1,C,20 N2,C,13 N3,C,4 N4,N,7,2 <linebreak> Country Continent OECD 2004.00 <linebreak> Brunei Darussalam Asia N 0.00 <linebreak> –  James Conkling Feb 15 '13 at 5:03
    
@JamesConkling you should 1. edit your original question with enhancing information rather than create a new comment. 2. check the answer that solved the issue an answer. –  Brad Nesom Feb 15 '13 at 15:41

3 Answers 3

up vote 1 down vote accepted

Turns out Open Office was adding the new row of column names (N1,C,20 | N2,C,13 | N3,C,4 | N4,N,7,2 etc.) because some of the existing column names were only numbers. The problem persisted even after I reformatted the column row as text. However, after adding text to those column names, (e.g. changing 2004 to year_2004) Open Office stopped automatically inserting the new column names.

Problem solved--don't use only numeric characters as field names.

share|improve this answer

I've gotten around this problem by opening the file in Open Office and saving the file as a .dbf

share|improve this answer
    
I've tried saving the file as a .dbf in Open Office, but it too is not seeing the intended column names and instead creating a new row of column names. The data looks like this in Open Office: –  James Conkling Feb 15 '13 at 4:52

CSV should probably be in the format of...

Myidfield, country, contintent, OECD, YEAR
1,durusallem, Asia, N, 00000.00

The char fields I think will default to 255, the number field will take the size and decimal from the first value in the column.

csv being "comma separated values".
As per my other comment you should certainly stay away from a "." In the field name.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.