I have created a model in Pro that relies on two .csvs.
The .csvs are generated from a .xlsx export. The .xlsx export's headers have special characters and spaces.
I successfully created a script that opens the .xlsx files, cleans the headers, and saves them as a .csv to the project folder.
When opening the .csvs in excel or Notepad ++ the headers are correct. No spaces or special characters. However, one of the .csv files, when opened in pro has one header with a space. The other table opens in Pro as it does in Excel or Notepad ++.
Yesterday, these tables were opening as they should and the model was running. Today when I entered my cloud environment, my project was closed and when I went to open it, a backup was newer than the saved version, so I opened the backup. The model failed on a Calulate Field process and I have been battling this issue for 3 hours.
I have deleted the .csvs, cleared my Pro cache, reran the script. Everytime I open the ONE table all headers are correct except for one.
Please help! I am leaving this company next Friday and really would like to be able to deliver this product bebefore my time is up.
#TiredOfFightingOneSpace
P.S. I made a copy of the .csv I am having issues with and opened it in a new project and everything was correct.
Solved! Go to Solution.
Just a shot in the dark, is your workflow creating schema.ini files? More info here, may be they are confusing ArcPro in someway?
Edit it to remove the space. Nothing wrong with tweaking the ini file.
Just a shot in the dark, is your workflow creating schema.ini files? More info here, may be they are confusing ArcPro in someway?
Hi Adam,
From your description it sounds like you script is doing some of the work, but when it comes to that specific header it is not getting replace correctly. Have you tried replacing a space with an underscore "_" and see the changes occur for that field?
Perhaps a picture of before and after of this field header would help.
Before
After
After (in Pro)
I will give the "_" a shot, but it feels like some sort of cache or lock issue? I have made a copy and opened in new project and renamed the file from the script to "_new.csv" Both open as expected. It is when I rename the file back the issue occurs again.
The file name has to be consistent because I am hoping to call the model from the script that cleans the .csv for automation purposes.
I do have a schema.ini file in the project folder never heard of this until today. I do see at the bottom the table in question and the one field I am having issues with shows up with the space. Should I delete this .ini file or remove that reference?
Edit it to remove the space. Nothing wrong with tweaking the ini file.
SUCCESS!!!
I am not the most experienced GIS Analyst, but fighting a space for almost 3.5 hours has about killed me! I have gone through all my free characters with ChatGPT. Lesson learned start with ESRI Community! Thank you both for your time!!!