INTERACT FORUM

Please login or register.

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

Author Topic: File Paths and Calculated Fields  (Read 849 times)

EpF

  • Citizen of the Universe
  • *****
  • Posts: 649
File Paths and Calculated Fields
« on: August 21, 2011, 01:13:24 pm »

I've been trying to create expressions that I can store in calculated fields which contain file paths for renaming files, but the back-slashes keep getting converted to underscores in the 'rename, move and copy' dialogue.

For example, I have this expression:
Code: [Select]
if(isequal([media type],Video),
    if(isequal([sub-type],Film),
        if(isempty([series title]),
            Film/\[name],
        Film/\[series title]/\[episode #] - [name]),
    if(isequal([sub-type],TV Show),
        TV Show/\[tv show]/\[series #],
    MISC/\[sub-type]/\[artist]/\[album])
    ),
[filename])

When I use that expression in a calculated field called 'Move Video File', the escaped back-slashes show up correctly when the field is used in a panes display, but in the 'Rule:' section of 'Directories' when using 'Rename, Move & Copy', the back-slashes become underscores which means the field can't be used for renaming.

Anyone have a way around this, or am I doing something wrong?

Edit: I know you can additionally use 'Find & Replace' to replace the underscores with back-slashes, but because any other punctuation marks in the filenames (like question marks, excalmation marks or colons - common enough in media names) get turned into underscores as well, this messes up the directory structure of a lot of files - is there a way to get back-slashes to show up literally in filenames when they come from calculated fields?

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: File Paths and Calculated Fields
« Reply #1 on: August 21, 2011, 02:16:59 pm »

Include

Replace([your calculated field here],_,\)

in your Directories Rule.
Logged
The opinions I express represent my own folly.

EpF

  • Citizen of the Universe
  • *****
  • Posts: 649
Re: File Paths and Calculated Fields
« Reply #2 on: August 21, 2011, 02:18:38 pm »

Cheers MrC! I was just about to post the same thing back!
Pages: [1]   Go Up