title
Products            Buy            Support Forum            Professional            About            Codec Central
 

Dynamic Folder Renaming

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • grivad

    • Jan 2017
    • 3

    Dynamic Folder Renaming

    Long time user of dBpoweramp and consider myself pretty well versed with dynamic naming, but I'm pulling my hair out with this one.

    I convert different lossless sources to ALAC, typically either WAV->ALAC, FLAC->ALAC, or ALAC->ALAC if I need to resample.

    Directory structure is like this:

    X:\Some\Folder\Artist - Year - Album (wav)
    X:\Some\Folder\Artist - Year - Album (flac)
    X:\Some\Folder\Artist - Year - Album (alac)

    What I'm trying to do is replace the existing codec indicator in the directory with a new one, e.g., replace (wav) with (wav-alac), or (alac) with (alac-alac):

    X:\Some\Folder\Artist - Year - Album (wav-alac)

    I've spent hours using numerous combinations of [BACKFOLDER]1[] with [GRAB], [RIGHT], [REPLACE], [IFEQUALS], [IF], etc. and nothing seems to work. The closest I've gotten is a direct copy of the directory name, with zero replacements (i.e., destination retains the (wav) at the end).

    [REPLACE] seems like the most straightforward, but I can't get it to work and documentation on the site is unclear:
    [REPLACE]search,replacement,string[] string is searched for the search string and is substituted with the replacement. To use tags write string as [tag]tagname[].

    So does this mean "string" (third argument) is searched for in "search" (first argument), and replaced with "replacement" (second argument)? I.e.,

    [REPLACE][BACKFOLDER]1[],(wav-alac),(wav)[] ?
    This doesn't work.

    I've also tried [REPLACE](wav),(wav-alac),[] and other combinations of empty arguments and shifting of arguments, none work.

    [IFEQUALS] and [IF] are giving similar (non) results. Using [GRAB] and [RIGHT] to do string comparisons/operations has also proved fruitless. I can use [RIGHT] to get the last 5/6 characters of the folder (i.e., "(wav" or "(flac)"), but then can't really seem to do anything with it. [GRAB] also doesn't seem to have the ability to grab everything but the last 5 characters, unless this just isn't clearly documented again.

    I can't imagine this is that complicated of an operation. Once I can get this simple first operation to work, I can get more creative with dynamic placement and usage of the encoding codec.

    Help?
  • Spoon
    Administrator
    • Apr 2002
    • 44515

    #2
    Re: Dynamic Folder Renaming

    Use:

    [extension]
    Spoon
    www.dbpoweramp.com

    Comment

    • grivad

      • Jan 2017
      • 3

      #3
      Re: Dynamic Folder Renaming

      Originally posted by Spoon
      Use:

      [extension]
      Thanks for the response, but I'm not sure how this will do what I need?

      Extension will give me .wav or .m4a, which I can use as a condition to use the right string, sure.. but the problem I'm having is truncating/replacing the last part of the directory name. [REPLACE] and [IF*] statements don't seem to do what I need them to..

      Is what I'm trying to do, removing/replacing the last part of a directory name, possible? If so, how?

      Comment

      • Dat Ei
        dBpoweramp Guru

        • Feb 2014
        • 1787

        #4
        Re: Dynamic Folder Renaming

        Maybe it's a better idea and easier solution to rebuild and recreate the structure than to replace parts of the folder names.


        Dat Ei

        Comment

        • grivad

          • Jan 2017
          • 3

          #5
          Re: Dynamic Folder Renaming

          I do these conversions in small sets (most of the time) so can make the changes manually, or can use a file/folder renaming tool to make the corrections afterwards without too much additional effort, but wanted to see if dBpoweramp could do it for me to save some steps

          It SEEMED like the available functions could do it, so was actually more curious about how the functions worked and if I was using them incorrectly.. Maybe it's possible to get the help pages updated with examples for each function? Is this something the community can help with to not burden illustrate with the additional documentation?

          Thanks for your help!

          Comment

          • mville
            dBpoweramp Guru

            • Dec 2008
            • 4021

            #6
            Re: Dynamic Folder Renaming

            Try [origpath] - ([extension])\[origfilename]

            e.g. X:\Some\Folder\Artist - Year - Album (wav)
            becomes X:\Some\Folder\Artist - Year - Album (wav) - (mp3)

            Comment

            • mville
              dBpoweramp Guru

              • Dec 2008
              • 4021

              #7
              Re: Dynamic Folder Renaming

              Originally posted by grivad
              It SEEMED like the available functions could do it, so was actually more curious about how the functions worked and if I was using them incorrectly..
              The [REPLACE] function was added in R16.x. I have R15.3, so I can't test it. Which version of dBpoweramp are you using?

              Comment

              • mville
                dBpoweramp Guru

                • Dec 2008
                • 4021

                #8
                Re: Dynamic Folder Renaming

                Originally posted by grivad
                [REPLACE][BACKFOLDER]1[],(wav-alac),(wav)[] ?
                This doesn't work.

                I've also tried [REPLACE](wav),(wav-alac),[] and other combinations of empty arguments and shifting of arguments, none work.
                The syntax is wrong. The function is [REPLACE]search,replacement,string[]

                so, in your example, you would need [REPLACE](wav),(wav-alac),[BACKFOLDER]1[][]

                where search = (wav), replacement = (wav-alac) and string = [BACKFOLDER]1[]

                Comment

                Working...

                ]]>