Joining Textfile to Shapefile Differences in ArcGIS versions

414
8
06-19-2014 07:27 AM
MaryV
by
New Contributor
I am trying to join a textfile generated in stata that includes caoname, caoid, and fips. The fips code should match to a shapefile county map that matches to the cntyidfp category. In ArcGIS 10.0, doing a straightforward join based on these attributes works. However, in 10.2, ArcGIS only allows for the joining of the cntyidfp to the caoname, which is completely useless. What's the difference between the two versions that makes this difficult? I have tried exporting to an excel document first, ensuring both the fips and cntyidfp data have the same number of characters, and creating a new table of the textfile within arcgis, but none of these solutions seem to work. What am I missing? Any insight would be appreciated, thank you.
0 Kudos
8 Replies
JoeBorgione
MVP Esteemed Contributor
I've never attempted to join (or relate) a text file; is creating a real-live geodatabase table from the text file an option for you?
That should just about do it....
0 Kudos
MaryV
by
New Contributor
What exactly do you mean by that? I'm starting to figure out that I'm pretty sure the main problem is that the fips data is being considered numeric by arcgis when it's actually a string value; would doing that solve this problem?
0 Kudos
JoeBorgione
MVP Esteemed Contributor
As you described in your original post, you have a text file (.txt) with information in it that you want to join to your feature class.  I'm suggesting to import the .txt file into a table format within the same geodatabase your feature class is.  I prefer to work within ArcGIS all the time; I don't like csv files, excel spreadsheets etc.  I like database tables.

Right click on your geodatabase and select import table.  With the All Filters option you can pretty much import any type of file out there.  Once you select your file, you can use the Field Map window to specify how each field will be typed (text, double, long int, etc).
That should just about do it....
0 Kudos
MaryV
by
New Contributor
I just tried doing this and it will not let me specify the fips as text because "the table or feature class is not empty", which seems logical, but I'm confused as to why you can't edit when this is true?
0 Kudos
JoeBorgione
MVP Esteemed Contributor
I just tried doing this and it will not let me specify the fips as text because "the table or feature class is not empty", which seems logical, but I'm confused as to why you can't edit when this is true?


Can you post a copy of the source data?  Are you trying to import it into an existing table?  If so use a different output name.
That should just about do it....
0 Kudos
MaryV
by
New Contributor
Actually I figured it out by cheating and just creating a few dummy lines of text. Thank you for the help though!
0 Kudos
JoeBorgione
MVP Esteemed Contributor
.... I figured it out by cheating...


It's not cheating if it works. Glad you got it figured out.  Care to share your solution so others may benefit?
That should just about do it....
0 Kudos
MaryV
by
New Contributor
Of course! Create a few lines of dummy text at the beginning of the textfile just so arcgis recognizes it's text.
0 Kudos