I have a bunch of files inside a folder that I want to get the Date Modified and Created from and copy it into a text document or some kind of tab delimited document. I have no idea how to do this.
Opening each one and manually copy/pasting the Creation Date is not an option, as this is hundreds of files.
Can this operation be automated or scripted?
EDIT: I found that using the following will give me all the various date formats and puts them in a txt file, and all dates preserved:
(stat -f "%N%tAccess:%t%Sa%tModify:%t%Sm%tChange:%t%Sc%tBirth:%t%SB" *)>creation.txt
However, when I then try to copy that information into an excel sheet, even though it keeps the days and times, all the years are changed to 2023.
txt file:
EXAMPLE.mp3 Access: Dec 9 11:48:21 2023 Modify: May 19 21:37:55 2020 Change: Dec 7 19:03:24 2023 Birth: Nov 26 06:07:58 2014
Pasted into excel spreadsheet:
EXAMPLE.mp3 Access: Saturday, December 9, 2023 Modify: Friday, May 19, 2023 Change: Thursday, December 7, 2023 Birth: Sunday, November 26, 2023
ls -l file.whatever
and then hand edit the results to show us the date format you need? This will be fairly straightforward with tools likeawk
andls
- edit these in the question if possible so everyone can see the request in the body and not the comments