The dukes of hazzard create a sub directory

All about user-defined episode / movie / file name format expressions
Post Reply
RBCC
Posts: 118
Joined: 17 May 2016, 02:23

The dukes of hazzard create a sub directory

Post by RBCC »

I am using the following :

Code: Select all

T:\The Dukes of Hazzard\{"Season∶" +s}{"Year∶ "}{y} {d.format("MMM dd, yyyy")} {n}{": "}{t} {duration.format ("HH:mm:ss")}
What do I need to do to copy episode 1 of season 3 in an not pre-made directory in the directory T:\The Dukes of Hazzard Season 3 Year 1981 ?
John :D
RBCC
Posts: 118
Joined: 17 May 2016, 02:23

Re: The dukes of hazzard create a sub directory

Post by RBCC »

Below is a picture of what I am trying to do:

Image

Does a Subdirectory have exist in order to rename it?

John
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: The dukes of hazzard create a sub directory

Post by rednoah »

FileBot will move files into the exact file path generated by your custom format. A file path uses / or \ (you can use either) to separate each folder level, so you likely just need to add a / in your format at that point in the file path where you want to create an additional folder level. FileBot will create new directories as necessary as files are moved into the exact file path specified by your custom format.


e.g. this format will create a folder level for each series name:

Code: Select all

X:/TV Shows/{n}/{s00e00} - {t}
e.g. this format will put all files into the same folder:

Code: Select all

X:/TV Shows/{n} - {s00e00} - {t}
:idea: Please read the FAQ and How to Request Help.
RBCC
Posts: 118
Joined: 17 May 2016, 02:23

Re: The dukes of hazzard create a sub directory

Post by RBCC »

How would I do this :
Copy to this folder : M:\The Dukes of Hazzard\Season 3∶ [airdate.format(yyyy)][would I put another '\' here?] ...Start to rename file here?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: The dukes of hazzard create a sub directory

Post by rednoah »

1. Decide what target file path you want
2. Write a format that generates the file path you want



e.g.

1. I want to move / rename my files like so:

Code: Select all

X:/TV Shows/Alias/Season 1/Alias - S01E01 - Truth Be Told.mp4
2. I replace the variable parts with variables, so I now have a format that moves and organises files into the file and folder structure I want:

Code: Select all

X:/TV Shows/{n}/Season {s}/{n} - {s00e00} - {t}
:arrow: If you have trouble, then give us a (1) example target file path so that we can give you a (2) custom format that generates that file path in return.
:idea: Please read the FAQ and How to Request Help.
RBCC
Posts: 118
Joined: 17 May 2016, 02:23

Re: The dukes of hazzard create a sub directory

Post by RBCC »

The picture below will explain what I want to do: go to here:

Image

the flle is named The Dukes of hazzard 3x1
Thank you for your help
John
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: The dukes of hazzard create a sub directory

Post by rednoah »

Sorry, I don't really understand your screenshot... Please follow my example and illustrate your use case in this form:
rednoah wrote: 08 May 2022, 13:39 1. I want to move / rename my files like so:

Code: Select all

X:/TV Shows/Alias/Season 1/Alias - S01E01 - Truth Be Told.mp4

EDIT:

:!: Note that your "target directory" and "how I want to read it" folder is just two different folders. I'm not sure if you mean this to be two different folders, or one folder that has one name but is somehow displayed with another name. In any case, please provide the complete target file path you want as text.
:idea: Please read the FAQ and How to Request Help.
RBCC
Posts: 118
Joined: 17 May 2016, 02:23

Re: The dukes of hazzard create a sub directory

Post by RBCC »

Code: Select all

M:\The Dukes of Hazzard\Season 5 Year 1990 [code] 
This is the "target " Directory 

Using :
M:\The Dukes of Hazzard\Season {s} Year {yyyy}
[code]M:\The Dukes of Hazzard\Season {s} Year {yyyy}
thats all folks
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: The dukes of hazzard create a sub directory

Post by rednoah »

Your specification does not specify the file name, so we will assume {n} - {s00e00} - {t} standard naming here.


:!: Note that FileBot does not rename folders. FileBot instead rewrites file paths, and your format is thus expected to generate the complete file path (excluding the file extension) for each file / episode match at hand.


e.g. sample file path:

Code: Select all

M:\The Dukes of Hazzard\Season 5 Year 1983\The Dukes of Hazzard - S05E01 - The New Dukes
e.g. sample format:

Code: Select all

M:\{n}\Season {s} Year {sy.last()}\{n} - {s00e00} - {t}
e.g. sample output path for episodes 1x01, 2x01, etc:

Code: Select all

$ filebot -list --q "the dukes of hazzard" --format "M:\{n}\Season {s} Year {sy.last()}\{n} - {s00e00} - {t}" --filter "e == 1"
M:\The Dukes of Hazzard\Season 1 Year 1979\The Dukes of Hazzard - S01E01 - One-Armed Bandits
M:\The Dukes of Hazzard\Season 2 Year 1980\The Dukes of Hazzard - S02E01 - Days of Shine and Roses
M:\The Dukes of Hazzard\Season 3 Year 1981\The Dukes of Hazzard - S03E01 - Carnival Of Thrills (Part 1)
M:\The Dukes of Hazzard\Season 4 Year 1982\The Dukes of Hazzard - S04E01 - Mrs. Daisy Hogg
M:\The Dukes of Hazzard\Season 5 Year 1983\The Dukes of Hazzard - S05E01 - The New Dukes
M:\The Dukes of Hazzard\Season 6 Year 1984\The Dukes of Hazzard - S06E01 - Lulu's Gone Away
M:\The Dukes of Hazzard\Season 7 Year 1985\The Dukes of Hazzard - S07E01 - Happy Birthday, General Lee

:idea: The {sy} season years binding will give you the years in which episodes of this season aired, often-case multiple years. {sy.last()} will give you the last year (presumably the value you want based on your examples in previous posts) in which episodes of this season aired.
:idea: Please read the FAQ and How to Request Help.
RBCC
Posts: 118
Joined: 17 May 2016, 02:23

Re: The dukes of hazzard create a sub directory

Post by RBCC »

I don't understand generate complete file path. Does this mean it can only move it into a existing directory?
Can it make a directory if there isn't a existing directory.?
Can it rename an existing directory and place files in that directory?

John
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: The dukes of hazzard create a sub directory

Post by rednoah »

:idea: FileBot will create directories as necessary.

e.g. if M: is empty then FileBot will create folders The Dukes of Hazzard and Season 1 Year 1979 and them move/rename (in a single atomic operation) the source file (e.g. TDH.1x01.mp4) to The Dukes of Hazzard - S01E01 - One-Armed Bandits.mp4 into that newly created folder:

Code: Select all

M:\The Dukes of Hazzard\Season 1 Year 1979\The Dukes of Hazzard - S01E01 - One-Armed Bandits


:idea: FileBot does not rename directories. FileBot does however create necessary directories and delete left-behind empty directories, so the result is essential the same if you move all files from the source folder into a new location.




Terms and Definitions:

This is a complete file path:

Code: Select all

M:\The Dukes of Hazzard\Season 1 Year 1979\The Dukes of Hazzard - S01E01 - One-Armed Bandits.mp4
This is the root folder / drive letter:

Code: Select all

M:
This this is the parent parent folder name:

Code: Select all

The Dukes of Hazzard
This this is the parent folder name:

Code: Select all

Season 1 Year 1979
This is a file name without extension:

Code: Select all

The Dukes of Hazzard - S01E01 - One-Armed Bandits
This is the file extension:

Code: Select all

mp4
:idea: Please read the FAQ and How to Request Help.
RBCC
Posts: 118
Joined: 17 May 2016, 02:23

Re: The dukes of hazzard create a sub directory

Post by RBCC »

I get it ..thank you for all your great help.
Post Reply