INTERACT FORUM

Please login or register.

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

Author Topic: How to concatenate when using fill properties from file name?  (Read 2528 times)

thecrow

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 457
How to concatenate when using fill properties from file name?
« on: September 05, 2016, 11:26:53 am »

I am tagging some videos which are arranged within descriptive sub folders.
e.g. D:\Training\Course Name\2. Chapter Name\1. Filename.wmv
I would like to use "Fill Properties From Filename" or another tool to concatenate the chapter name and filename into the files Name tag. So that I end up with the Name tag "Chapter Name - Filename".
I can either use the folder name or the file name but I cannot workout how to concatenate them into a single Name tag.
Anyone know how to do this?
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: How to concatenate when using fill properties from file name?
« Reply #1 on: September 05, 2016, 07:51:44 pm »

lets use your example (d:\training \course name\...)

levels:  0 is the parent (d:), 1 is \Training, 2 is \course name etc.

just select a file, open the tag window, and in the [name] field type

=filefolder([filename,0],3) - filefolder([filename,0],4)

this should give you

2. Chapter Name - 1. Filename

in the name field.  we can deal with the numbers etc. after you have it working on a few files...

note:  the syntax is (the 0 in the square brackets is needed to force datatype)

filefolder([field with the folder levels, usually filename, 0], level to pull from)

what i would do is make a new custom field with the formula, so that you can work with it really easily without doing any damage to the existing [name] tag, then use a smartlist to modify as needed, then you can get happy with the changes and easily change all the tags in one go afterwards
Logged

thecrow

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 457
Re: How to concatenate when using fill properties from file name?
« Reply #2 on: September 06, 2016, 07:24:22 am »

Thanks ferday for pointing me in the right direction. What I ended up with is:

  =removeleft(filefolder([filename,0],0),3) - removeleft(filename([filename,0],0),5)

For the benefit of anyone else wanting to do something similar:
[filename,0] simply references the name and path of the file.
e.g. "D:\Training\Course Name\02.Chapter Name\0102.Filename.wmv"

The filefolder() function http://wiki.jriver.com/index.php/FileFolder()#FileFolder retrieve the part of the path specified but numbers from right to left so 0 is the folder containing the file and higher numbers specify folders closer to the root of the drive.
In my example "02.Chapter Name"

The filename() function http://wiki.jriver.com/index.php/FileFolder()#FileName retrieves the name of the file with the option 0 discarding the file suffix.
In my example "0102.Filename"
N.B. filename() is a function and different from [filename,0] which references a field.

The removeleft() function http://wiki.jriver.com/index.php/RemoveLeft()#RemoveLeft removes a specific number of characters from the string so I could get rid of the preceding numbers in my file path.
The first one removes 3 characters leaving me  "Chapter Name" and the second 5 leaving me "Filename"

Putting it all together give me "Chapter Name - Filename"

I then selected all the files I want to edit and using the tag editor pasted my expression into the name tag and hey presto all my tags are updated.

Thanks again
Logged
Pages: [1]   Go Up