Filename to releasetime - a little help?


Hi, folks--forgive me my naivete, since I barely speak regex.

I have a lot of files--NPR stories, to be specific--where the filename begins with a 8-character string that is the release date in YYYYMMDD form. I'd like to create an action to insert this string into the releasetime field as MM/DD/YYYY so that I don't have to adjust each day's worth of files manually.

The filenames all look like this: 20171201_atc_the_disaster_artist_is_the_best_movie_about_a_bad_movie

Is this something that can be done? Thanks.


(Format action)


Or you could add this to a new column for easy sorting using (in the sort part of the new column ui)



Actually, the field RELEASETIME has the format
So a transformation into MM/DD/YYYY would create an invalid releasetime.
If you want to get it right, then proceed as follows:
Create an action group with several actions as follows:

Format value for RELEASETIME
Format string: $regexp(%_filename%,^(\d+).*,$1)
This imports the leading number from the filename into RELEASETIME

Then insert the separators and a dummy time at the end:
Format value for RELEASETIME
Format string: $regexp(%releasetime%,(\d\d\d\d)(\d\d)(\d\d),$1-$2-$3T00:00:00Z)


Thank you both--I'll give those a try!