#1 2013-03-18 03:26

tosh9i
Member
Registered: 2013-03-12
Posts: 7

Move Part of Filename, shift for 3 positions to the left

I have a ton of files that are like this:
File 01 (720p).mp4
File 01.mp4
File 02 (720p).mp4
File 02.mp4
File 03 (720p).mp4
File 03.mp4

I want to move (720p) (Note: half of the files have (720p) in them, but they're in different parts of the filename) 3 spaces to the left, so it'd look like this:
File (720p) 01.mp4
File (720p) 02.mp4
File (720p) 03.mp4
File 01.mp4
File 02.mp4
File 03.mp4

Last edited by tosh9i (2013-03-18 03:46)

Offline

#2 2013-03-18 03:54

narayan
Senior Member
Registered: 2009-02-08
Posts: 470

Re: Move Part of Filename, shift for 3 positions to the left

Hi tosh9i,

A simpler way is to search for "(720p)" in Windows Explorer, drag-n-drop all those files in ReNamer.

In ReNamer, just delete the last 7 characters and then insert the string (720p) at position#5.

Here are the steps:
1. Add the Delete rule with these settings: From delimiter " (", To delimiter ")" 
  (Enter the text without quotes. Note the space in the "from delimiter" field).
2. Add the Insert rule with these settings: Insert " (720p)", Position 7.
(Enter the text without quotes. Note the space in "Insert" field.)

Last edited by narayan (2013-03-18 03:55)

Offline

#3 2013-03-18 04:04

tosh9i
Member
Registered: 2013-03-12
Posts: 7

Re: Move Part of Filename, shift for 3 positions to the left

That wouldn't quite work well enough.  For starters, I'd have to select the 720p files one by one since they're mixed in with the other files like this:

File 01 (720p).mp4
File 01.mp4
File 02 (720p).mp4
File 02.mp4
File 03 (720p).mp4
File 03.mp4

And it goes on until about eps 26, and that's only 1 series among many.

I have hundreds of files like that.

Offline

#4 2013-03-18 07:22

narayan
Senior Member
Registered: 2009-02-08
Posts: 470

Re: Move Part of Filename, shift for 3 positions to the left

Oh I started with one method of trimming the (720p) part, and then changed it; but forgot to change the manner in which you add files.

Actually you can go ahead and add all your files. No need to find only files with (720p) string. ReNamer will simply ignore the other files. Try on a few files first.

Tip-1: You don't have to rename the files. Check out the preview first.
Tip-2: Activating the "Highlight changed names" (SHFT+H) helps.

I am not sure what you mean by "eps 26".

But if your basic problem statement is:
"There are two sets of files, with the only difference that in one set there is a string enclosed in pair of parentheses (); and you have to shift that part elsewhere."

      -Then this trick will work.

No need for complex script, etc.

Last edited by narayan (2013-03-18 07:27)

Offline

#5 2013-03-18 18:29

tosh9i
Member
Registered: 2013-03-12
Posts: 7

Re: Move Part of Filename, shift for 3 positions to the left

Since some of the filenames have 6 characters and the other filenames have up to 35 characters, the place to put the (720p) is different for each series.

But, the (720p) comes right after the episode number, so, I just need to shift (720p) 3 spaces to the left.  If I removed (720p) and then Inserted it in Position 7, then it'd end up being in the middle of a word for some of them.

PS: when I said,  "eps 26", I meant that a typical season has 26 episodes.

Offline

#6 2013-03-18 19:38

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Move Part of Filename, shift for 3 positions to the left

tosh9i wrote:

Since some of the filenames have 6 characters and the other filenames have up to 35 characters, the place to put the (720p) is different for each series.

But, the (720p) comes right after the episode number, so, I just need to shift (720p) 3 spaces to the left.

Then best provide better examples in first place so we do not have to guess that many.



shift "(720p)" for 3 positions  to the left:

FROM:
File 01.mp4
File 01 (720p).mp4
File 02.mp4
File 02 (720p) text.mp4
File 03.mp4
File name 03 (720p).mp4
File name 04 (720p) extra text.mp4
File name extra 23 05 (720p) 45 text.mp4

TO:
File 01.mp4
File (720p) 01.mp4
File 02.mp4
File (720p) 02 text.mp4
File 03.mp4
File name (720p) 03.mp4
File name (720p) 04 extra text.mp4
File name extra 23 (720p) 05 45 text.mp4

USE:
RegEx Rule: Replace expression "^(.+)(...)( \(720p\))(.+)?$" with "$1$3$2$4" (skip extension)

Means:
Match one-or-more of any sign, till three any signs, followed by "(720p)", followed by none-or-more of any sign or not.
What is captured by the regex in brackets can be reused in the replacement, as we do but rearrange the order to $1 $3 $2 $4.

See our wiki for more:
http://www.den4b.com/wiki/ReNamer:Rules:RegEx
http://www.den4b.com/wiki/ReNamer:Regular_Expressions


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#7 2013-03-19 04:52

tosh9i
Member
Registered: 2013-03-12
Posts: 7

Re: Move Part of Filename, shift for 3 positions to the left

Stefan wrote:
tosh9i wrote:

Since some of the filenames have 6 characters and the other filenames have up to 35 characters, the place to put the (720p) is different for each series.

But, the (720p) comes right after the episode number, so, I just need to shift (720p) 3 spaces to the left.

Then best provide better examples in first place so we do not have to guess that many.



shift "(720p)" for 3 positions  to the left:

FROM:
File 01.mp4
File 01 (720p).mp4
File 02.mp4
File 02 (720p) text.mp4
File 03.mp4
File name 03 (720p).mp4
File name 04 (720p) extra text.mp4
File name extra 23 05 (720p) 45 text.mp4

TO:
File 01.mp4
File (720p) 01.mp4
File 02.mp4
File (720p) 02 text.mp4
File 03.mp4
File name (720p) 03.mp4
File name (720p) 04 extra text.mp4
File name extra 23 (720p) 05 45 text.mp4

USE:
RegEx Rule: Replace expression "^(.+)(...)( \(720p\))(.+)?$" with "$1$3$2$4" (skip extension)

Means:
Match one-or-more of any sign, till three any signs, followed by "(720p)", followed by none-or-more of any sign or not.


Thanks, that worked perfectly.

Offline

#8 2013-03-22 03:40

Andrew
Senior Member
Registered: 2008-05-22
Posts: 542

Re: Move Part of Filename, shift for 3 positions to the left

narayan wrote:

A simpler way is to search for "(720p)" in Windows Explorer, drag-n-drop all those files in ReNamer.

tosh9i wrote:

That wouldn't quite work well enough.  For starters, I'd have to select the 720p files one by one since they're mixed in with the other files like this:

File 01 (720p).mp4
File 01.mp4
File 02 (720p).mp4
File 02.mp4
File 03 (720p).mp4
File 03.mp4

And it goes on until about eps 26, and that's only 1 series among many.

I have hundreds of files like that.

Actually Narayan's suggestion would have worked perfectly. In Windows 7 for example, if you type *720p*.mp4 in Explorer's search box (top right of window), it will show you only MP4 files with the string "720p" in them. You can then simply select all and drag-drop onto ReNamer. Anyway your problem seems to have been solved already.

Offline

Board footer

Powered by FluxBB