I have a lot of files in folder with filenames like
20190618_213557.mp4
20190620_231105.mp4
20190623_101654.mp4
..
I need to change creati
I had the same problems trying to set the date from filename, and struggled a lot with the code suggested here.
Have to be careful to use the same variable letter for the loop and in the brackets! for i in... {x:4:2}
should be for i in... {i:4:2}
at least on mac and finish with a semicolon before done. This code should work:
for i in *.mp4; do
SetFile -d "${i:4:2}/${i:6:2}/${i:0:4} ${i:9:2}:${i:11:2}:${i:13:2}" "$i";
done