Hi folks,
Apologies in advance if this is an obvious one, my brain is a small bit fried.
I have a directory of similarly named files (think bookings.csv), and I want to do one or both of the following:
1. Add a column within each of the files in the Directory showing the creation time for that specific file so that I can use this information to differentiate age of records within a larger input of all of the files.
2. Rename each of the files within the Directory with its individual Creation time (for same reasons as above).
I've had a go at doing this using Dynamic Input, formula tool, append...........I'm just not getting the right outcome.
Can someone point me in the right direction?
If it's useful, the reason I want to do this is to take the latest information for each customer booking across all the files. These are .csv files exported weekly from an in-house system by someone else, and I need to use it to create an overall picture of bookings over a specified period of months. I can't unfortunately just use the latest file, as when bookings are completed, they get removed from the system prior to export.
Thanks in advance!
Solved! Go to Solution.
Can you not use the 'Directory' tool on the folder where you have all the files? The Directory tool provide lots of attributes on the files like:
File name, Directory, Creation time, Last Access time, Size, etc.
Please provide more clarity if this is a tool you can't use or have used and not had success OR if the problem is something else.
Thanks for the quick response! I'm not sure if I'm just being stupid, but I want to take the Creation Time column from the Directory Input and add the creation time for each file as a field within that specific file.
e.g. for bookings1.csv, I would want to add the CreationTime for bookings1.csv as a field within bookings1.csv.
Absolutely doable - when you are reading the file, check the option "Output file name as field"; bring the directory tool and get the 'Creation date' and 'fullpath' and join the 'filename' from input file to 'fullpath' from directory tool and you have the data with creation date. High level screen shot and output:
Any questions pls post else would recommend you mark this answer as 'solved' as more people can refer back to this solution in future 🙂
Thanks a mill, appreciate it - was definitely overcomplicating things for myself!
Agreed, sometimes I just step away and get some fresh air! Glad it worked for you
User | Count |
---|---|
19 | |
15 | |
13 | |
9 | |
8 |