INTERACT FORUM

More => Old Versions => Media Center 15 (Development Ended) => Topic started by: glynor on October 12, 2010, 10:55:54 am

Title: Need Help Parsing Date From Filename (Please)
Post by: glynor on October 12, 2010, 10:55:54 am
I need a big favor for a work project, if someone who has some MC-date-foo wouldn't mind helping me.

I have a WHOLE BUNCH of files that are named in the following format:

20100920-1032-highseas-720pW
20100921-1457-highseas-360pW


I need to extract some metadata out of those filenames.  What I need help with is extracting the [Date] field.  The first two hyphen delimited sections are the date of the file (the time field is in 24hr time, obviously).  The rest of the file name includes the Event Location and then the format of the video (I know how to handle that stuff).

Unfortunately, the files themselves do NOT have the proper Date Modified/Created anymore, because they've been FTPed around and whatnot, so the Date MC uses on import is wrong.  I need to extract the date and time out of the filename, and get it into the [Date] field in MC.  I am completely clueless on how to do this.  Can anyone help me?

I'm going to have to do this a lot, so I'd like an "expression" that I can save in the Fill Properties from Filename tool and use it at will.
Title: Re: Need Help Parsing Date From Filename (Please)
Post by: gappie on October 12, 2010, 11:19:32 am
not sure how to do it with fill properties. but using
Code: [Select]
=mid([filename (name)],4,2)//mid([filename (name)],6,2)//mid([filename (name)],0,4)in the date field seems to work.. i think i got the order of month/day right.
this does not fill in the time though.. do you need that too?

 :)
gab
Title: Re: Need Help Parsing Date From Filename (Please)
Post by: glynor on October 12, 2010, 11:31:22 am
Yeah... I ABSOLUTELY need the time.

There are usually 15-20 different recordings per day.  The only way to tell them apart until they are fully tagged is by the time.
Title: Re: Need Help Parsing Date From Filename (Please)
Post by: gappie on October 12, 2010, 11:38:22 am
Code: [Select]
=mid([filename (name)],4,2)//mid([filename (name)],6,2)//mid([filename (name)],0,4) mid([filename (name)],9,2):mid([filename (name)],11,2)this works for me.. but check the order, with me being european and all.

i think using the fill properties is not possible, at least not with expressions.
but who knows?

 :)
gab
Title: Re: Need Help Parsing Date From Filename (Please)
Post by: glynor on October 12, 2010, 12:44:14 pm
That works PERFECTLY.  You are an absolute champion!!   :D  ;D