INTERACT FORUM

Please login or register.

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

Author Topic: Struggling to Fill Properties with Date information  (Read 504 times)

bspachman

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 896
Struggling to Fill Properties with Date information
« on: February 22, 2024, 06:26:12 pm »

Dates always give me a hard time :(

I'm looking to use the "Fill Properties from Filename" tool to get dates extracted from the filename and into MC, but cannot find the magic combo to make it work. The filenames are all of the form:

<track>_<name>_<mmddyyyy>.mp4

When I use the naming template [Track #]_[Name]_[Date], only about 1/3 of the files extract any date information at all, and those that do seem to be using the internal integer notation when I look at the files in library view.

Using [Track #]_[Date]_[Month][Day][Year] isn't working for me either. The few files I look at in the preview show the month as "December" when they are not.

Any field/expression wizards available to tell me what I am overlooking? :)

Thanks in advance,
brad
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9143
Re: Struggling to Fill Properties with Date information
« Reply #1 on: February 22, 2024, 11:25:58 pm »

Working with dates makes my head hurt :D

What format does your system use? Mine uses dd/MM/yyyy
MC always attempts to follow the system date format.

I got what you want, but it was a two step process...

I used the "Fill Properties" tool to bring the whole date string into a string defined field. For my test, I used the [Comment] field.
I then selected the file, and, in the tag window, edit the date field by putting this into the date field and pressing <Enter>...
Code: [Select]
=mid([comment],2,2)//mid([comment],0,2)//mid([comment],4,4)
[Comment] contained 02202024
After entering the expression above into the [Date] field, [Date] became 20/02/2024

Note that I switched the day and month values so that they matched my system date format.
Test with one file first until you're happy, then you can select multiple files and do them all at once.
After the dates are correct, you can safely delete the contents of the [Comment] field.

There's a strong possibility that there's a more direct way to achieve this, but until one comes along, this should hopefully get you going.

Good luck.

bspachman

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 896
Re: Struggling to Fill Properties with Date information
« Reply #2 on: February 23, 2024, 12:20:12 pm »

Marko--

Thanks! Not entirely the solution I was expecting, but two great things about it...
1) I understand it!
2) It works great!

I ended up creating a new string-based library field to hold the temporary version of my date and switched the 'mid' commands around so that it worked for my US-based date formatting.

I'm moving on from this part of my project (thanks to you), but I wonder if using slashes '/' in the filename would have helped "Fill Properties" extract and fill the Date field directly. Of course, the slash character often causes problems with filesystems, so that may not have been allowed in the first place.

Obligatory possible bug note:
In the "Fill Properties" dialog, my template in the path section wrapped to 2 lines in the entry field. When using backspace to delete information from the template I had previously entered, the insertion point jumps to the top of the entry field when the template becomes short enough to fit on a single line. Maybe just me?

To reiterate...thanks!
Logged

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: Struggling to Fill Properties with Date information
« Reply #3 on: February 23, 2024, 02:07:47 pm »

I don't think you can parse the date without any delimiters  with fill properties tool. You can however do it like marko said or other option is to set fill properties to ignore the last part with rule [Track #]_[Name]_[]
and then edit dates with expression in Date field. Notation below being converted from mmddyyyy to dd//mm//yyyy as per ConvertDate documentation
Code: [Select]
=ConvertDate(Mid(Right(Filename(,0),8),2,2)//Mid(Right(Filename(,0),8),0,2)//Right(Filename(,0),4))
If you are auto importing the files then you can parse everything automatically with auto import rules and don't need to manually fill properties from filename and use the expression

Logged
Pages: [1]   Go Up