0

I have a .csv file that has unique identifiers that I'd like to join with some legislative district shapefiles in QGIS. I've done this before, and the joins all worked fine -- and technically it still works if I memorize the order of the columns, though when I upload the .csv using "Add Vector Layer" like normal -- my .csv gets imported properly, except my headers are all in as the first row and the headers are all "field_1," "field_2," etc.

Converting the file to .dbf in OpenOffice and I attempted converting the line breaks by using this in Terminal:

tr '\15' '\n' < infile.csv > outfile.csv

Still no luck. Any other ideas to import my .csv and retaining all my column headers?

2 Answers 2

1

Use the Add Delimited Text Layer add option. It has much better handling of CSV then what OGR has via the Add Vector Layer add option.

1

I just realized that one of my column headers was solely a number -- which I thought I'd fixed. Sorry about that! If you're ever having this problem, please make sure none of your column headers are numbers; it makes QGIS assume it's a value instead of a header.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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