#1 2010-05-29 18:53

syphoon
Member
Registered: 2010-05-29
Posts: 1

Comments for rules & improvement for Remove Rule

2 suggestions

First of I would like to thank you for your amazing software > ReNamer. Using this soft will save my actually lot of my time and do not need to rename files manually anymore.... THANK YOU A MILION!!!!!!!!!!!!!!!

While i was using it i came to few thinks which could be usefull for me and maybe for others too:

1. Possibility of adding comments to rules (I'm actually using 69 rules at the same time and sometimes i would like to add some note to rule... if someone ask why 69 rules, its because i rename hundreds of mp3's)

2. In remove rule add another option at how many first\last characters you can remove the string. Exampe: im trying to adjust file: a-testa-song_name.mp3 > using rule to remove a- > result: testsong_name.mp3, so my suggestion is too add a field where you can specify at which first\last character you can apply this rule, so if you add there number 3 it will try to remove the a- only at first 3 characters from the file which you are changing

... I want to add option to do not change content while changing rules, but i found it in settings!

Overall really good and sophisticated software, once again Thank you!

Offline

#2 2010-05-29 21:14

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

Re: Comments for rules & improvement for Remove Rule

Hi syphoon, welcome.

Please remember next time
* to use an thread for ONE issue only.
* use more fitting subjects then "2 suggestions" only!

Thread one
ReNamer: i need comments for rules

syphoon wrote:

First of I would like to thank you for your amazing software > ReNamer. Using this soft will save my actually lot of my time and do not need to rename files manually anymore.... THANK YOU A MILION!!!!!!!!!!!!!!!

While i was using it i came to few thinks which could be usefull for me and maybe for others too:

1. Possibility of adding comments to rules (I'm actually using 69 rules at the same time and sometimes i would like to add some note to rule... if someone ask why 69 rules, its because i rename hundreds of mp3's)

You could use an existent thread for that request, i just searched for "comment rules"
See http://www.den4b.com/forum/viewtopic.php?id=554




thread two
ReNamer: improvement suggestion for Remove Rule

2. In remove rule add another option at how many first\last characters you can remove the string.
Exampe: im trying to adjust file: a-testa-song_name.mp3 > using rule to remove a- > result: testsong_name.mp3
, so my suggestion is too add a field where you can specify at which first\last character you can apply this rule,
so if you add there number 3 it will try to remove the a- only at first 3 characters from the file which you are changing

... I want to add option to do not change content while changing rules, but i found it in settings!

Overall really good and sophisticated software, once again Thank you!

I am not sure if i really understood what you asked for.

You mean you want an result like:
FROM:
a-testa-song_name.mp3
TO:
testa-song_name.mp3
but you got:
testsong_name.mp3


???
Then just check "[X] First" in "Remove Rule" for your example.


If it is not that simple we can use RegEx Rule.
If you have more questions, just ask.


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

#3 2010-05-29 22:46

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

Re: Comments for rules & improvement for Remove Rule

After a while i understand you better.

To search and replace an string with an another string or nothing
and only between pos n and the next m chars (for example: from pos 3 for the next 10 chars incl. char at start pos)
you can use an PascalScript Rule like this.
To search at two or more positions for other occurrences, add this script more then once.

//PascalScript Rule to extent the "Remove Rule"
//RegEx Search and Replace an String only between pos n and m
//
//To search and replace an string with an another string or nothing
//and only between pos n and the next m chars (for example: from pos 3 for the next 10 chars incl. char at start pos)
//you can use an PascalScript Rule like this.
//To search at two or more positions for other occurrences, add this script more then once.
//
//See the WIKI for more about using Rules => http://www.den4b.com/wiki/ReNamer:Rules
//in special => http://www.den4b.com/wiki/ReNamer:Rules:PascalScript
//and for more about the RegEx Syntax => http://www.den4b.com/wiki/ReNamer:Regular_Expressions


var
 StartToSearchAtChar, ForTheNextNChars: integer;
 substrB, substrM, substrA, RegExStrToRemove, RegExStrAsReplacement: WideString;
 bRegExCaseSensitive, bRegExUseSubstitution: Boolean;
 
begin
////// Settings
  StartToSearchAtChar := 1; // use 1 to start at the beginning
  ForTheNextNChars := 3; // use 999 to search all
  RegExStrToRemove := 'a-'; //search for this between ' and '. Use '.+' for all
  RegExStrAsReplacement := ''; // replace with this. Use '' to remove
  bRegExCaseSensitive := TRUE;
  bRegExUseSubstitution := FALSE;  
  
///// Check the conditions
  //
  //

///// Do it
  //Split the name into three parts (before/middle/after):
  substrB := WideCopy(WideExtractBaseName(FileName),1,StartToSearchAtChar-1);
  substrM := WideCopy(WideExtractBaseName(FileName),StartToSearchAtChar,ForTheNextNChars);
  substrA := WideCopy(WideExtractBaseName(FileName),StartToSearchAtChar+ForTheNextNChars, 999);

  //Remove the string:
  substrM := ReplaceRegEx(substrM, RegExStrToRemove, RegExStrAsReplacement, bRegExCaseSensitive, bRegExUseSubstitution);

  //Build the new name:
  FileName := substrB + substrM + substrA + WideExtractFileExt(FileName);
end.


HTH?

See the WIKI for more about using Rules
=> http://www.den4b.com/wiki/ReNamer:Rules
in special
=> http://www.den4b.com/wiki/ReNamer:Rules:PascalScript
and for more about the RegEx Syntax
=> 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

#4 2010-05-30 10:52

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

Re: Comments for rules & improvement for Remove Rule

I had some time to extent my script a little.
1. Optional search for the starting pos automatically by let the script searching for an char like '-'
2. Prompt the user with an info about the settings

Note: this script is not widely tested. So test it first with some test files.


{
/*
PascalScript Rule to extent the "Remove Rule"
RegEx Search and Replace an String only between pos n and m

To search and replace an string with an another string or nothing
and only between pos n and the next m chars (for example: from pos 3 for the next 10 chars incl. char at start pos)
you can use an PascalScript Rule like this.
To search at two or more positions for other occurrences, add this script more then once.

See the WIKI for more about using Rules => http://www.den4b.com/wiki/ReNamer:Rules
in special => http://www.den4b.com/wiki/ReNamer:Rules:PascalScript
and for more about the RegEx Syntax => http://www.den4b.com/wiki/ReNamer:Regular_Expressions
*/
}


var
 StartToSearchAtChar, ForTheNextNChars: integer;
 substrB, substrM, substrM2, substrA, RegExStrToRemove, RegExStrAsReplacement, strpos: WideString;
 bRegExCaseSensitive, bRegExUseSubstitution, binit: Boolean;
 
begin
////// Settings
  StartToSearchAtChar := 1; // use 1 to start at the beginning
  ForTheNextNChars := 9; // incl. the start pos. Use 999 to search all
  RegExStrToRemove := 'a-'; //search for this between ' and '. Use '.+' for all
  RegExStrAsReplacement := ''; // replace with this. Use '' to remove
  bRegExCaseSensitive := TRUE;
  bRegExUseSubstitution := FALSE;  
  
  // Find the StartToSearchAtChar automatically by searching the first occurrence of  char 'x'
     strpos := '';  // use '' to disable this feature
     IF (strpos <> '') then
         StartToSearchAtChar := pos(strpos, WideExtractBaseName(FileName));
  
///// Check the conditions (not really needed)
   //IF (ForTheNextNChars = 0) Then exit;
   //IF (ForTheNextNChars > Length(WideExtractBaseName(FileName))-StartToSearchAtChar) Then exit;



///// Do it
  //Split the name into three parts (before/middle/after):
  substrB := WideCopy(WideExtractBaseName(FileName),1,StartToSearchAtChar-1);
  substrM := WideCopy(WideExtractBaseName(FileName),StartToSearchAtChar,ForTheNextNChars);
  substrA := WideCopy(WideExtractBaseName(FileName),StartToSearchAtChar+ForTheNextNChars, 999);

  //Remove the string:
  substrM2 := ReplaceRegEx(substrM, RegExStrToRemove, RegExStrAsReplacement, bRegExCaseSensitive, bRegExUseSubstitution);


///Information. Prompt the user one time with the current settings:
  IF (binit=False) then
  begin
    showmessage('Search only from char pos '+IntToStr(StartToSearchAtChar)
     + ' for the next ' +IntToStr(ForTheNextNChars) + ' chars incl. start position' 
     + #13#10 + #13#10 + 'Settings:' + #13#10
     + 'StartToSearchAtChar found autom. by string: <' + strpos + '>'  +  #13#10
     + 'StartToSearchAtChar: <'   + IntToStr(StartToSearchAtChar)+ '>' +  #13#10
     + 'ForTheNextNChars: <'      + IntToStr(ForTheNextNChars)+ '> incl. the start char' +  #13#10 
     + 'String to search in: <'   + substrM + '>'                      +  #13#10 
     + 'RegExStrToRemove: <'      + RegExStrToRemove + '>'             +  #13#10 
     + 'RegExStrAsReplacement: <' + RegExStrAsReplacement + '>'        +  #13#10  + #13#10 
     + 'Result for test string: ' + #13#10 + FileName + #13#10 + '<' + substrM2 + '>' + #13#10 
     );
     // + 'bRegExCaseSensitive: <'   + bRegExCaseSensitive + '>'       +  #13#10 
     // + 'bRegExUseSubstitution: <' + bRegExUseSubstitution + '>'     +  #13#10 
     binit :=True;
  end;



  //Build the new name:
  FileName := substrB + substrM2 + substrA + WideExtractFileExt(FileName);
end.

HTH?
If yes, help two others too, and spent some money to Den4b Denis.

_


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

Board footer

Powered by FluxBB