0

I have a csv file that contains a field with an ID in a certain format that ArcMap seems to recognize as a coordinate (e.g. "11X355"). When I add it to a map in ArcMap 10.6, it automatically adds two new fields, appending _X and _Y to the original field name and displaying coordinates (-121.488717,0.000496).

How do I stop this from happening? I believe this may be related to another issue with displaying XY data (using other fields), otherwise I could just ignore the new fields.

  • It sounds like you actually have two problems here. Please Edit the question to focus on the problem you want solved first. The irony here is that the virtual columns you don't want can be used to detect parsing failure. – Vince Nov 21 '18 at 1:17
  • Ok - edited. I'm not sure what you mean about using the virtual columns to detect parsing failure, but I did look at those fields in the resulting attribute table for the exported shapefile and couldn't find a pattern. – s_bklyn Nov 21 '18 at 16:02
  • Please clarify how you are adding this CSV to your map document. – Vince Nov 21 '18 at 16:47
  • Just as CSV through Add Data – s_bklyn Nov 21 '18 at 20:11
2

Firstly, you don't need to do this. Your issue is not that ArcGIS is adding these virtual fields. There is something else amiss with your CSV. Perhaps, you have invalid data somewhere or a column with a value that is too big for the default field size that ArcGIS, e.g. Why is FeatureClassToFeatureClass tool Failing on Long cell values (Arc 10.2)? and Forcing ArcMap to Ignore Double Quotation Mark In CSV Text Field When Exporting to Shapefile?

Secondly, The *_X & *_Y fields are discussed in "How coordinate information is determined". You can't turn it off in general, but you can override the behaviour on a file by file basis by creating a schema.ini file that specifies your ID field is text. See "Overriding how text files are formatted".

For example, I have test.csv and test1.csv files in C:\Temp. Both contain exactly the same data:

NAME, ID, X, Y
BLAHBLAH, 11X355, 135.0, -25.0

I also have a schema.ini file in C:\Temp that contains:

[test1.csv]
Col2=ID Text

When I add test.csv to ArcMap I get the virtual fields, but not when I add test1.csv.

enter image description here

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.