Page 1 of 1

move single file from folder to parent, then delete folder?

Posted: 08 Jan 2015, 00:33
by jeffrey11
I'm trying to mass rename Southpark, about 30% of the files are stored in their own folder eg:

-rw-rw-rw- 1 debian-transmission debian-transmission 84242318 Sep 25 15:10 South Park - 18x01 - Go Fund Yourself.mp4
-rw-rw-rw- 1 debian-transmission debian-transmission 98974631 Oct 2 17:00 South Park - 18x02 - Gluten Free Ebola.mp4
-rw-rw-rw- 1 debian-transmission debian-transmission 80916289 Oct 9 14:55 South Park - 18x03 - The Cissy.mp4
-rw-rw-rw- 1 debian-transmission debian-transmission 103685920 Oct 16 15:27 South Park - 18x04 - Handicar.mp4
-rw-rw-rw- 1 debian-transmission debian-transmission 296853841 Nov 13 18:43 South Park - 18x07 - Grounded Vindaloop.mkv
-rw-rw-rw- 1 debian-transmission debian-transmission 338422799 Nov 23 17:33 South Park - 18x08 - Cock Magic.mkv
drwxrwxrwx 2 debian-transmission debian-transmission 5 Jan 8 11:12 South.Park.S18E05.720p.HDTV.x264-KILLERS[rarbg]
drwxrwxrwx 3 debian-transmission debian-transmission 6 Jan 8 11:12 South.Park.S18E06.720p.HDTV.X264-DIMENSION[rarbg]
drwxrwxrwx 2 debian-transmission debian-transmission 5 Jan 8 11:12 South.Park.S18E09.HDTV.x264-KILLERS[rarbg]
drwxrwxrwx 2 debian-transmission debian-transmission 5 Jan 8 11:12 South.Park.S18E10.HDTV.x264-KILLERS[rarbg]

Is there an easy way to do this?

Re: move single file from folder to parent, then delete fold

Posted: 08 Jan 2015, 04:41
by rednoah
Move into new structure & delete left-behind folders.

Re: move single file from folder to parent, then delete fold

Posted: 08 Jan 2015, 05:39
by jeffrey11
rednoah wrote:Move into new structure & delete left-behind folders.
Hmm I can't seem to find a guide for this, command line only.

Re: move single file from folder to parent, then delete fold

Posted: 08 Jan 2015, 05:51
by rednoah
To move files into a new structure means specifying an absolute path as format. Whatever remains in the original location you can easily delete yourself by deleting the parent folder.

Re: move single file from folder to parent, then delete fold

Posted: 15 Feb 2016, 19:41
by kim
1 up = {file.parentFile}/{fn}
2 up = {file.parentFile.parentFile}/{fn}

Grab name of the folder 1 steps up = {file.parentFile.name}
Grab name of the folder 2 steps up = {file.parentFile.parentFile.name}

Re: move single file from folder to parent, then delete fold

Posted: 16 Feb 2016, 07:45
by rednoah
What he said. But using {folder} or {folder.parent} or {folder.dir} etc will make things slightly less verbose.