There has to be a problem with the CSV file.
Possibilities include (but are not limited to):
- Spaces and/or non-alphanumeric characters in field names, or starting with underscore.
- Bad data in cells. Esri only reads the first few lines to decide the data type, if the first dozen or so are numbers it calls the field integer, if there's later a value like 'N/A' in the field then it has a spit!
- Duplicated field names, when shortened to 10 characters.
- 'reserved' field names: FID, SHAPE etc..
- Permission denied by OS
I have tested this on a table:
x,y,z,h,r,p,t
152.75815,-28.34317,2467.171222,204.403864,-0.215472,-4.31432,540751.6635
152.758058,-28.343492,2467.048023,204.305248,-2.287749,-4.916747,540752.2636
152.757997,-28.343707,2466.870526,204.225232,-3.082666,-5.08145,540752.6637
152.757951,-28.343868,2466.693121,204.137175,-3.269405,-5.160663,540752.9637
152.757921,-28.343976,2466.551302,204.07381,-3.172274,-5.225498,540753.1638
152.757891,-28.344084,2466.390267,204.015868,-2.910663,-5.244445,540753.3638
152.757847,-28.344247,2466.137704,203.965636,-2.264,-5.294325,540753.6639
152.757772,-28.344518,2465.655387,203.89813,-1.057936,-5.344787,540754.164
152.757699,-28.34479,2465.164517,203.946887,-0.757532,-5.433305,540754.6641
152.757639,-28.345007,2464.784946,203.900885,-0.882926,-5.508097,540755.0642
152.75755,-28.345335,2464.12202,203.710554,-1.899527,-5.6251,540755.6643
with the code:
import arcpy
inCSV=r'D:\some\path\OneRun_with_Header.csv'
outShp = r'D:\some\path\test'
arcpy.MakeXYEventLayer_management(inCSV,"x","y","Lyr")
arcpy.CopyFeatures_management("Lyr",outShp)
and it works just fine. Have a closer look at your tabular data, there's bound to be a problem there. I did notice on your previous post:
arcpy.MakeXYEventLayer_management(Wells_csv, "Surface_Longitude", "Surface_Longitude", Wells_Layer,
has "Surface_Longitude" for X and Y - this doesn't affect the tool too much but you'll end up with all your features on a 45degree slope with the same X and Y.
', "", "0", "0", "0"'
and get the same results I'm looking for a solution that allows me to automate this work flow. – risail Mar 4 '15 at 23:18