#1 : 15/04-20 02:22 Carlos
Posts: 4
|
Hello, i have several files that start like this
W23 RandomName1.txt W66 RandomName2.txt W34 RandomName3.txt W67 RandomName4.txt I want the first 4 (including space) characters gone, it will ALWAYS be 2 numbers from 0 to 9 and the letter will ALWAYS be "W", (note that Its not a given that it will have the pattern at all) RandomName1.txt RandomName2.txt RandomName3.txt RandomName4.txt I figured how to do it in a primitive way (literally removing one by one), but i figured there should be a better way, when i tried to implement a wildcard by myself all it did was delete everything ahead. Thanks --edit, made it a little less messed up |
#2 : 15/04-20 07:49 David Lee
Posts: 1125
|
Replace: "^W\d{2} "
with: blank Case sensitive Use regular expressions |
#3 : 16/04-20 02:14 Carlos
Posts: 4
|
Reply to #2:
Thanks for the help, but doesnt seem to work? |
#4 : 16/04-20 09:19 David Lee
Posts: 1125
|
Reply to #3:
Works for me. Make sure that you have copied the regex exactly - but do NOT include the quotation marks. Occurrence: All or 1st Apply to: Name |
#5 : 20/04-20 11:53 Carlos
Posts: 4
|
Reply to #4:
Ah, yeah indeed it does work, my files just happened to had brackets [] encapsulating that text so apparently that was an issue, i just ran a remove searching for brackets before this and now it works, thanks! However it doesnt seem to work if the file contains WXX anywhere but in the beginning of the filename IE: TestName W73.txt |
#6 : 20/04-20 15:31 David Lee
Posts: 1125
|
Reply to #5:
That's because you specified that your files START with this sequence! The "^" character specifies "start of string" so you will need to remove that. However depending on where the sequence lies within the filename you will need to remove a space either before or after "Wxx". To do this use the search string: "(W\d{2} )|( W\d{2})". The "|" character means match either of the two substrings. If "Wxx" is enclosed in brackets then you can use: "(\[W\d{2}\] )|( \[W\d{2}\])" and if the brackets are optional then: "(\[?W\d{2}\]? )|( \[?W\d{2}\]?)" "[" and "]" have special meanings in a regular expression - preceding them with the escape character - "\" - means that they will represent themselves instead. "?" following a character means the character is optional - ie match either zero or one repetitions. |
#7 : 20/04-20 21:50 Carlos
Posts: 4
|
Reply to #6:
Ah, i see, actually yes the Wxx are at the start, i just happen to have several other patterns i want to remove which are not -- not that it matters, thank you so much for the explanations. |
#8 : 06/05-20 17:19 Jack Wiga
Posts: 3
|
I know that DuplicateFilesDeleter and highly recommended this program is simple fast and solves the any problem.
|