INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Need Help Parsing Date From Filename (Please)  (Read 1497 times)

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Need Help Parsing Date From Filename (Please)
« 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.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

gappie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4580
Re: Need Help Parsing Date From Filename (Please)
« Reply #1 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
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Need Help Parsing Date From Filename (Please)
« Reply #2 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.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

gappie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4580
Re: Need Help Parsing Date From Filename (Please)
« Reply #3 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
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Need Help Parsing Date From Filename (Please)
« Reply #4 on: October 12, 2010, 12:44:14 pm »

That works PERFECTLY.  You are an absolute champion!!   :D  ;D
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/
Pages: [1]   Go Up