Geographic Information Systems Asked by Cheee on September 24, 2020
I’m trying to merge multiple tables using the Join Field function in ArcPy. This script currently runs perfectly to merge the multiple tables but gives the columns new names. However, I will like the file name appended to the new columns as they are added to the table.
How can I modify my code to add columns with the file name appended?
import arcpy
arcpy.env.workspace = "d:/INDICES5/Pixelnum/SAVI"
tables = arcpy.ListTables()
in_data = "d:/INDICES5/Pixelnum/SAVI/PixelnumSAVI2020.dbf"
for table in tables:
arcpy.JoinField_management(in_data,"Pixel_num", table,"Pixel_num")
There are lots of issues you have not discussed that make this question non-trivial.
So you need resolve those issues as you build your field name, this is nothing more than simple string manipulation which you could research on the internet.
To overcome the limitation of short field names you would need to join your data to a file geodatabase table as they support much long field names and also field aliases.
Answered by Hornbydd on September 24, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP