ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > DC Member Programs and Projects

remv: Rename files (and directories) with regular expressions

<< < (7/8) > >>

Tuxman:
You and your cheeky test cases.
The expected outcome should be a simulation (-n).  :P

Your flags suggest that


--- ---\test\test2\One\two\three\ozorroee\ofile.text
should be renamed to


--- ---\test\test2\One\twd\three\ozorroee\ofile.txtxt
Or something.  :huh:

Surprise me: Which one have I forgot to log this time?

4wd:
Surprise me:-Tuxman (January 14, 2019, 05:36 PM)
--- End quote ---

Surprise!



remv -sdrvv "o(.+)e(.+)" d$1$2 test



remv -sdrvv "o(?:.+)e(.+)" d$1$2 test

--- Code: Text ---K:\>remv -sdrvv "o(?:.+)e(.+)" d$1$2 test Renaming           'test\test2\One\two\three\ozorroee\ofile.txt' to 'test\test2\One\twd.txt' ...Successfully renamed test\test2\One\two\three\ozorroee\ofile.txt to test\test2\One\twd.txt. Renaming           'test\test2\One\two\three\ozorroee' to 'test\test2\One\twde' ...Successfully renamed test\test2\One\two\three\ozorroee to test\test2\One\twde. Processed        'test\test2\One\two\three' ... Skipping         'test\test2\One\two' ... Skipping         'test\test2\One' ... Skipping         'test\test2' ... [STATS] Renamed 2 files and directories (0 failed, 4 skipped).


Or something.  :huh:-Tuxman (January 14, 2019, 05:36 PM)
--- End quote ---

 :P

OK, so if I've got this right, maybe, the full path is split into two parts only to be acted upon:


* \test\test2\One\two\three\ozorroee\
* ofile.text
?

Tuxman:
Yup, "processed" is a new output in 1.3.0, it means that the rename_file() function had created the target directory already.  :)
(Because if I would just count that as "exists", it'd fail.)

Ha!

Tuxman:
OK, so if I've got this right, maybe, the full path is split into two parts only to be acted upon:


* \test\test2\One\two\three\ozorroee\
* ofile.text
?
-4wd (January 14, 2019, 05:50 PM)
--- End quote ---

Starting with the current version, more or less.

With -dr, the whole path is seen as one string (with or without the file's extension  ;)), regex_replace() is applied to it.
Without -dr, only the second part (= the file name, with or without the file's extension  ;)) will be processed. In fact, the regex_search() function will not even see the parent path anymore.


--- Code: C++ ---if (bRenameDirectories) {    // If the user has decided to not rename directories, why would we    // want to rename paths on the way?    out_path_stream << parent_path_stream.str();}
(Stop modifying your postings while I reply to them.  :mad: :-[)

4wd:
OK, so if I've got this right, maybe, the full path is split into two parts only to be acted upon:


* \test\test2\One\two\three\ozorroee\
* ofile.text
?
-4wd (January 14, 2019, 05:50 PM)
--- End quote ---

Starting with the current version, more or less.

With -dr, the whole path is seen as one string (with or without the file's extension  ;)), regex_replace() is applied to it.
Without -d, only the second part (= the file name, with or without the file's extension  ;)) will be processed.

(Stop modifying your postings while I reply to them.  :mad: :-[)
-Tuxman (January 14, 2019, 06:06 PM)
--- End quote ---

OK, now it makes sense ... was completely at odds with every other rename program I've used  ;D

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version