How to add a file name as a field in attribute table

5873
3
05-09-2017 05:54 PM
JenniferAblaza
New Contributor

I have over 15 thousand files I need to process and keep track of for my Master's thesis...

For each file's attribute table, I would like to create a field called "File" and have a small part of the file name inputted in the field. In general, the files are named in this format...

DMS_1581721_00175_20141113_14432701_DICresult....etc...

I would just like the number that is bolded and italicized to be inputted in the File field. 

Any ideas? Not sure what code to use or how to even load the code. Thanks for the help!

0 Kudos
3 Replies
JenniferAblaza
New Contributor

I forgot to mention that the number changes in the amount of digits it has. 

0 Kudos
AbdullahAnter
Occasional Contributor III
DanPatterson_Retired
MVP Emeritus

Adding a field to 15000 files just to put a portion of a filename in it wouldn't be recommended.  There are better ways of managing the record of your files to keep track of them.  It might be useful if you specified your data structure and whether you are using geodatabases exclusively, shapefiles, a combination of the two and what other types of data do you need to keep track of.

0 Kudos