Add a space before each capital letter in the file name

A swapping-ground for Regular Expression syntax

Re: Add a space before each capital letter in the file name

Postby bru » Fri Feb 21, 2020 5:23 pm

Hi.. Yes, it is indeed very hard to explain.. Words just dont seem to be enough.. And to top it off, I typo'd.
What I meant to say is that the lead groups themselves dont cause backtracking as a result matching too much.
But future matches, especially the mandated-ones(7/8) will backtrack to get a match, stealing from prior ones, if that makes sense.

So in the case of IFeelTheEarthMove, I definitely expect any LeadGroups:1-6 to give-up Earth & Move to Groups7/8 (possibly several times).
But I think you're saying that, upon this instance of recalculating the LeadGroups, that only Group1 itself never changes ??
I've really never thought about WhichGroup# the intermediate saves-as, merely how it achieve the final Group#-match.
(Mandated ones 1st from left-to-right, then the optionals from left-to-right).

If that is what you're saying, and sorry for not getting the wording any better, it does seem puzzling.
I do have a theory, but something tells me its gonna make a lot more sense once I can see the whole formatted section.

Looks like I'm gonna have to set up another account, the forum simply wont let me update the email in profile settings!
Tried everything.. Havent used it in a while.. Guess we're not allowed to change emails??
Will reply with new account..
bru
 
Posts: 62
Joined: Wed Jan 31, 2018 7:35 pm

Re: Add a space before each capital letter in the file name

Postby RegexNinja » Fri Feb 21, 2020 6:15 pm

Bru here.. New account with a good email.. Like the name better too! Please have them send your email to mine, or vice-versa.
If the admins are reading this, please feel free to delete the bru-account, dont know if 2 accounts are against the rules.
I meant to create it as brc anyway.
RegexNinja
 
Posts: 134
Joined: Fri Feb 21, 2020 5:26 pm

Re: Add a space before each capital letter in the file name

Postby trm2 » Fri Feb 21, 2020 7:34 pm

No wonder I have not heard from you - your account must be deleted (I'm guessing) - but they sent my email address to you already - you should have it.
If not, I don't understand. I got confirmation of this on Feb 19th. Please check into this - look for the email from support - that is the
how they sent it, I'm sure. I can't give it out here - against the rules as you know.

Yes as far as the backtracking that is what I am referring to. Now you understand. The backtracking I have illustrated in the analysis
is correct. Once you see the section it should all make sense. I have my answers and I just need you to see my interpretation of the
results.

Meanwhile I saw another post of yours of RegEx that is going to require future further analysis but I am working on
volume II at the moment so I will get to it when I can. Not sure when. Once I do, and if it is still viable and I think at this
point it will be - I will include it in the book. I know I title them as manuals - they started out that way, but they are books
from cover to cover. Currently Volume II stands at 431 pages and counting (may go up, may go down depending on my edits).

RegexNinja - huh? I have you in the book as bru.. not sure it would be fair to list you twice - have to think about that.

Let me know ASAP about the email. I have had it waiting here for a few days now. Your turn to reach out through the Admin
to send me your new email address if you don't have it - just include in your request that it has already been approved by their
management. I can understand changing names but you changed the email address as well. They probably sent it to your other
email so check there first.
trm2
 
Posts: 156
Joined: Wed Jan 15, 2020 12:47 pm

Re: Add a space before each capital letter in the file name

Postby trm2 » Fri Feb 21, 2020 7:48 pm

bru wrote:Hi.. Yes, it is indeed very hard to explain.. Words just dont seem to be enough.. And to top it off, I typo'd.
What I meant to say is that the lead groups themselves dont cause backtracking as a result matching too much.
But future matches, especially the mandated-ones(7/8) will backtrack to get a match, stealing from prior ones, if that makes sense.


Yes of course it does - that is already in the analysis.

bru wrote:So in the case of IFeelTheEarthMove, I definitely expect any LeadGroups:1-6 to give-up Earth & Move to Groups7/8 (possibly several times).
But I think you're saying that, upon this instance of recalculating the LeadGroups, that only Group1 itself never changes ??
I've really never thought about WhichGroup# the intermediate saves-as, merely how it achieve the final Group#-match.
(Mandated ones 1st from left-to-right, then the optionals from left-to-right).


Upon, re-examination I find that it is both Group 1 and Group 2 that do not change but because of this, I see the pattern now. That question has been answered.

bru wrote:If that is what you're saying, and sorry for not getting the wording any better, it does seem puzzling.
I do have a theory, but something tells me its gonna make a lot more sense once I can see the whole formatted section.


Ready to send. You will see that I compared it against my own - Mine locked into a specific number of words up to 9 and yours that can freely
handle up to 8 words - very similar in design but very contrasting in other ways - and that is what intrigued me - and I hope, the readers. I add
material that is suitable for teaching and also those I find interesting. These are both. All parties contributions to this example are included as
well, not just yours and mine as you will see if you ever get the material. Once that is done. I will close out of this post and move on unless
of course other contributions come in.

bru wrote:Looks like I'm gonna have to set up another account, the forum simply wont let me update the email in profile settings!
Tried everything.. Havent used it in a while.. Guess we're not allowed to change emails??
Will reply with new account..


See previous response concerning lost email address.. you should have mine already.
trm2
 
Posts: 156
Joined: Wed Jan 15, 2020 12:47 pm

Re: Add a space before each capital letter in the file name

Postby RegexNinja » Fri Feb 21, 2020 9:24 pm

Hi, the email account associated with the 'bru' account is no longer valid.. If they sent something there.. No telling who got it, if anyone.
We're not allowed to edit/update our email at UserControlPanel/Profile/EditAccountSettings.. So my only option was to create a whole new account.

Geez, its not supposed to be this hard.. PM's dont seem to work either.. Maybe we should try sending out smoke-signals instead.
Is the correct email... support@(ThisSite'sDomain)?? If so, I'll send an email there, requesting they give you my mine.
Cheers.
RegexNinja
 
Posts: 134
Joined: Fri Feb 21, 2020 5:26 pm

Re: Add a space before each capital letter in the file name

Postby trm2 » Fri Feb 21, 2020 9:34 pm

email is:

support@bulkrenameutility.co.uk

That is their general email support so I am sure it is okay to give it out - otherwise I will hear back from Admin
trm2
 
Posts: 156
Joined: Wed Jan 15, 2020 12:47 pm

Re: Add a space before each capital letter in the file name

Postby RegexNinja » Fri Feb 21, 2020 10:08 pm

Update.. Just sent request to that email.
RegexNinja
 
Posts: 134
Joined: Fri Feb 21, 2020 5:26 pm

Re: Add a space before each capital letter in the file name

Postby therube » Sat Feb 22, 2020 1:52 am

(
Basic:
Code: Select all
0010 BEGIN                                                                   
0020 LET X$="ThisIsATestOnlyATest.mp3"                                       
0030 PRINT X$                                                                 
0040 LET XX$=X$(1,1)                                                         
0050 FOR I=2 TO LEN(X$)                                                       
0060 IF X$(I,1)>"@" AND X$(I,1)<"[" THEN LET XX$=XX$+" "+X$(I,1) ELSE LET XX$=XX$+X$(I,1)
0070 PRINT XX$                                                               
0080 NEXT I                                                                   
0090 PRINT XX$                                                               


Output:
Code: Select all
ThisIsATestOnlyATest.mp3
Th
...
This                         
This I                       
This Is                       
This Is A                     
This Is A T                   
This Is A Te                 
This Is A Tes                 
This Is A Test               
This Is A Test O             
This Is A Test On             
This Is A Test Onl           
This Is A Test Only           
This Is A Test Only A         
This Is A Test Only A T       
This Is A Test Only A Te     
This Is A Test Only A Tes     
This Is A Test Only A Test   
This Is A Test Only A Test.   
This Is A Test Only A Test.m 
This Is A Test Only A Test.mp
This Is A Test Only A Test.mp3
This Is A Test Only A Test.mp3

)
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm

Re: Add a space before each capital letter in the file name

Postby trm2 » Sat Feb 22, 2020 2:38 am

Thank you therube, I'm aware it can be done in a myriad of ways. I have your Word Space method, Javascript method by Admin, the BRC Method by the
&N* formerly known as … bru, :) and two RegEx.. now I have your batch file method that I will test and add as well.
trm2
 
Posts: 156
Joined: Wed Jan 15, 2020 12:47 pm

Re: Add a space before each capital letter in the file name

Postby trm2 » Thu Feb 27, 2020 7:16 pm

Excuse typo therube - I meant to say Basic Language. Any chance you could provide your own analysis - especially the parsing using the
array?
trm2
 
Posts: 156
Joined: Wed Jan 15, 2020 12:47 pm

Re: Add a space before each capital letter in the file name

Postby trm2 » Wed Mar 04, 2020 8:35 pm

RegexNinja wrote:Update.. Just sent request to that email.



Just to let anyone else reading this. Thank you, RegexNinja. all set - we are in agreement and the code has been fully analyzed and documented.
trm2
 
Posts: 156
Joined: Wed Jan 15, 2020 12:47 pm

Re: Add a space before each capital letter in the file name

Postby trm2 » Sun May 03, 2020 8:30 pm

therube

What interpreter are you using for the BASIC language? Is this Visual Basic? I wanted to test it but I didn't want to
download the entire Visual Studio Community. Please let me know. I like the old days of Quick basic when you wanted to test
quick and dirty.
trm2
 
Posts: 156
Joined: Wed Jan 15, 2020 12:47 pm

Re: Add a space before each capital letter in the file name

Postby therube » Mon May 04, 2020 12:11 am

Basis Visual PRO/5.
(In the day, & today, multi-user, multi-OS. Platform Availability.)
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm

Re: Add a space before each capital letter in the file name

Postby trm2 » Mon May 04, 2020 1:35 am

Thank you.

Found QB64 which is a free compiler using the old standard QuickBasic

Not sure quite how to convert it though.. all sorts of errors - mostly subscript out of range.

LET X$ = "ThisIsATestOnlyATest.mp3"
PRINT X$
LET XX$ = X$(1, 1)
FOR I = 2 TO LEN(X$)
IF X$(I, 1) > "@" AND X$(I, 1) < "[" THEN XX$ = XX$ + " " + X$(I, 1) ELSE XX$ = XX$ + X$(I, 1)
PRINT XX$
NEXT I
PRINT XX$

Any idea?
trm2
 
Posts: 156
Joined: Wed Jan 15, 2020 12:47 pm

Re: Add a space before each capital letter in the file name

Postby therube » Tue May 05, 2020 8:01 pm

(I don't know Quick/Visual Basic, & what commands, functions, ... they may have available, much less syntax differences...)

In any case...

start small
check your output at each step

presumably this works

LET X$ = "ThisIsATestOnlyATest.mp3"
PRINT X$

at here, LET XX$ = X$(1, 1)
do a PRINT XX$ & see if XX$="T"

in this case, (1,1) is a "segmentation", start & length, so (1,1) is T, (1,2) is Th, (7,2) is AT...

LEN function has to exist.
LEN (X$) should return the length of the variable
do a PRINT LEN (X$) & see if it reports, 24 ...

on an ASCII Table, [A-Z] (i.e. the list CAPITAL letters) is proceeded by "@" & succeeded by "[", so that give you one method to test


now whether the syntax of other Basics allow checking in the manner I have done... ?
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm

PreviousNext

Return to Regular Expressions