Select to view content in your preferred language

When adding a .csv file as a standalone table to a project, is it a live connection or a static snapshot of the .csv file?

2823
8
Jump to solution
12-30-2020 12:10 PM
Labels (2)
PhilipLeGrone
New Contributor III

When a .csv file is added to a project as a standalone table, is it a live connection to the .csv file or a static snapshot of the file?

When updates have been made to the csv file since it was added to an ArcGIS Pro Project ,such as adding new columns and updating some field values, it seems that even after resetting the data source in Properties of the standalone table doesn't reflect the new updates in the standalone table. Is that expected? 

0 Kudos
1 Solution

Accepted Solutions
JoeBorgione
MVP Emeritus

I just did a little experiment:  I added a csv to a project, then saved an closed the project.  The I opened the csv in notepad and deleted four rows, saved it and exited notepad.  When I opened the project, I was surprised to see that the the csv was now four records short from the original.

What is odd though is I used notepad to make those changes.  I used excel and deleted a number of rows and those changes were not reflected in arcgis pro.  Can't explain that.

I've been using a ton of csv files lately and the more I use them the less I like them as a data source in ArcGIS Pro.  I'm taking data out of a mySql database to a csv; when I convert the csv to a table with the table to table tool, often times I lose date fields.  If I first save the csv to a .xls the date files are preserved; then I use excel to table.  But that's an additional step.  I don't much care for Excel at all, and only put up with it because I have to.

That should just about do it....

View solution in original post

8 Replies
DanPatterson
MVP Esteemed Contributor

Convert other table formats to geodatabase tables.  gdb tables behave well for the most part.

 Treat other formats (csv, excel etc) as convenience formats to communicate with other programs.

"hosting" is a totally different issue, which I don't think you are getting at.


... sort of retired...
PhilipLeGrone
New Contributor III

Thanks for your response. I'm trying to understand how the csv file connection works, and in particular whether that could be used as a source of live updates for non-geospatial information maintained by others to enrich an existing feature layer. 

0 Kudos
DanPatterson
MVP Esteemed Contributor

Unless you are doing life-critical mapping, there is little need to update a feature layer without a degree of intervention by a maintainer.  Any form has its problems, quality control being a major issue, and as @MervynLotter  points out "refreshes" can be an issue.


... sort of retired...
0 Kudos
MervynLotter
Regular Contributor

Hi Philip

I often make use of Excel files in the GP tool Make XY Event Layer and the content only updates after restarting Pro. 

 

Cheers

Mervyn

0 Kudos
JoeBorgione
MVP Emeritus

I just did a little experiment:  I added a csv to a project, then saved an closed the project.  The I opened the csv in notepad and deleted four rows, saved it and exited notepad.  When I opened the project, I was surprised to see that the the csv was now four records short from the original.

What is odd though is I used notepad to make those changes.  I used excel and deleted a number of rows and those changes were not reflected in arcgis pro.  Can't explain that.

I've been using a ton of csv files lately and the more I use them the less I like them as a data source in ArcGIS Pro.  I'm taking data out of a mySql database to a csv; when I convert the csv to a table with the table to table tool, often times I lose date fields.  If I first save the csv to a .xls the date files are preserved; then I use excel to table.  But that's an additional step.  I don't much care for Excel at all, and only put up with it because I have to.

That should just about do it....
PhilipLeGrone
New Contributor III

Thanks Dan & Mervyn for pointing out about the "refreshing" issue which requires restarting, and thanks Joe for testing it out! I can confirm that by restarting Pro and reopening the project, the updated information has been reflected in the Project now.

(Just a side note... interesting that the updates were made in Excel in my test case. Once difference is that my updates did not involve deleting rows - just adding columns and updating field values. Curious why Joe's test scenario of deleting records in Excel didn't go through even after restarting.)

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

I don't use Excel files in Pro, so I can't speak to that, but I do work with CSV files quite a bit in Pro.  The behavior of CSV files has improved some over time with Pro.  Early on with Pro, there were issues with cached data from CSV files not resulting in changed data showing up in Pro, but those issues have mostly been addressed by Pro 2.7.  That said, data updates and schema updates are two very different kinds of updates, and they get handled differently in Pro.

For CSV files, both data and schema updates from outside Pro are reflected in Pro projects, with a few caveats.  For CSV data updates outside Pro while the CSV file is opened in an active Pro session, the updates will show the next time the table is opened if it is closed.  If the table is already open, the "Refresh" button for the map or layout needs to be hit for the updates to show, or the table can be closed and reopened from the TOC to show the updates.  For CSV data updates outside Pro when a Pro project is not opened, the updates show the next time the project is opened.

Schema updates are trickier.  For CSV schema updates outside of Pro while the CSV file is opened in an active Pro session, the table must be removed from the TOC and re-added or the table in the TOC must be re-sourced to the CSV again.  If the CSV is used in a join to another table or layer, there is some additional schema caching that prevents the schema changes from showing even if the steps above are done.  To reflect the schema updates when a CSV is used in a join, either the project needs to be closed and opened or the join(s) needs to be removed, the table re-sourced, and the join(s) made again.

It would be interesting to compare how CSV files behave compared to Excel files.  I will test sometime and post again.

UPDATE:  The caching for Excel workbooks is more, well, more something.  Looking only at data updates, the only way to get data updates in Excel workbooks outside of Pro to show up appears to be closing the project and re-opening it.  Data updates for Excel workbooks are not dynamic at all like they are for CSV files.  I didn't test schemas, but I suspect they will be as restrictive/static or worse than data updates.

JoeBorgione
MVP Emeritus

I think the problem I was having with the changes not showing up after making edits in Excel is related to the fact that although I had closed the project, I had left the table open in the project.  So when I re-opened it, the original was cached.  That, and the experiment I did was with ArcGIS Pro 2.5.

@PhilipLeGrone , the take away from this discussion is sometimes you just have experiment a bit so you know what to expect.  Test your work flows.  Tweek them as needed.

Edited moments later: I opened my project and closed the csv, saved, and closed the project.  Then I edited the csv in Excel, adding a row; saved, closed Excel and reopened Pro.  When I opened the csv in Pro, my new record was there...

That should just about do it....