0

I wonder how I would write a table for a join which I want to perform. Right now I wrote a .txt File, tab-seperated. The headerline only contains letters. Here is the problematic table: http://www.filedropper.com/lookuptable I am working with the shapes provided here: http://www.eea.europa.eu/data-and-maps/data/clc-2006-vector-data-version

Thats how my file looks like:

ID  CLCCode CLCKlasse
1   111 test1
2   112 test2
3   121 test3
4   122 test4
5   123 test5
6   124 test6
...

Rightclick on the .shp. I choose my .txt file and the two needed fields to perform the join (my key and value pair). My key would be numbers in the attribute table of the shapefile which equals the numbers I wrote in my .txt file. But, ArcGIS says that there are no matching records.

I also tried it with a , as a seperator. I can choose in the dialog join the textfile, but, the field where it should be stays empty/blanc (it basically gets not selected).

Also, there is something I do not understand. When I open my .csv file in ArcGIS I see the "CLCCODE" column.But, I cannot choose "CLCCODE" in the Join Dialog, although it is a column of the attribute table.

Screen

  • 1
    An ASCII file isn't a table, just a potential source for a table. Please edit the question to specify details of the manifestation of unhappiness. – Vince May 11 '15 at 12:08
  • @Vince updated my question – Stophface May 11 '15 at 12:26
2

From the ArcGIS 10.1 Help:

Files with a .txt, .asc, or .csv extension are interpreted as comma delimited, while files with a .tab extension are interpreted as tab delimited by default. Any file with one of these extensions will be interpreted as a text file table even if it doesn't contain tabular data. If you attempt to display a text file that doesn't contain tabular data, the software will either produce an error or attempt to display the data as a table. To avoid this problem, give your delimited text files a .csv or a .tab extension. This will help differentiate text files with delimited data from unformatted text files.

Try changing the extension to .tab and see if that works.

Edit:

The problem with your join is the field in the shapefile is a Text field. Make a new integer field and use the field calculator to copy over the values. The join worked for me after I did that.

  • nope. that did not help. – Stophface May 11 '15 at 12:49
  • 1
    Can you verify that your file is actually tab delimited? The sample you posted in your question only has one space between CLCCode and CLCKlasse. – juturna May 11 '15 at 12:53
  • Yes I can! There are only tabs! – Stophface May 11 '15 at 13:02
  • You may need to provide a sample text file to see whether others can reproduce your result. – juturna May 11 '15 at 13:04
  • 1
    @Stophface Join must be based on fields of the same data type. If it's a string in your shapefile, it needs to be a string in your table. By default Arc scans the first 8 lines to determine data type. As suggested in some of your previous questions, when bringing in a text file to ArcGIS you can create a schema.ini file that defines the datatype for each of the columns to what you want rather than letting ArcGIS pick. This is discussed towards the bottom of the help file that juturna links to in the answer. – Chris W May 11 '15 at 21:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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