replace plus sign character with EVAL
Forum rules
iMacros EOL - Attention!
The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely,
The Progress Team
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
iMacros EOL - Attention!
The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely,
The Progress Team
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
replace plus sign character with EVAL
I am not able to make EVAL statement to replace + with a blank space
https://www.google.com/maps/place/126+W ... -83.033201
SET mAdd EVAL("var x='{{!URLCURRENT}}';x=x.split('place/')[1].split('/')[0];x.replace(/\+/g, ' ');")
PROMPT {{mAdd}}
replacement part needs a fix
iMacros 8.9.7
Windows 8.1
Firefox 47
https://www.google.com/maps/place/126+W ... -83.033201
SET mAdd EVAL("var x='{{!URLCURRENT}}';x=x.split('place/')[1].split('/')[0];x.replace(/\+/g, ' ');")
PROMPT {{mAdd}}
replacement part needs a fix
iMacros 8.9.7
Windows 8.1
Firefox 47
Last edited by techimac on Fri Sep 14, 2018 11:28 pm, edited 1 time in total.
Available for custom iim, javascript iMacros scripts
Re: replace plus charcater with EVAL
I know replace can be added after second split
will do once I know correct format of replacement text
will do once I know correct format of replacement text
Available for custom iim, javascript iMacros scripts
Re: replace plus charcater with EVAL
Available for custom iim, javascript iMacros scripts
Re: replace plus charcater with EVAL
SET mAdd EVAL("var x='{{!URLCURRENT}}';x=x.split('place/')[1].split('/')[0];x.replace(/i/g, ' ');")
PROMPT {{mAdd}}
can replace "i" but not "+"
PROMPT {{mAdd}}
can replace "i" but not "+"
Available for custom iim, javascript iMacros scripts
Re: replace plus character with EVAL
techimac wrote:I am not able to make EVAL statement to replace + with a blank space
https://www.google.com/maps/place/126+W ... -83.033201
replacement part needs a fixCode: Select all
SET mAdd EVAL("var x='{{!URLCURRENT}}';x=x.split('place/')[1].split('/')[0];x.replace(/\+/g, ' ');") PROMPT {{mAdd}}
iMacros 8.9.7
Windows 8.1
Firefox 47
techimac wrote:I know replace can be added after second split
will do once I know correct format of replacement text
techimac wrote:https://stackoverflow.com/questions/246 ... javascript
still cant make it work inside EVAL
Hum..., very impressed to see that you can make a bit of "Research" sometimes...! Very good...!techimac wrote:can replace "i" but not "+"Code: Select all
SET mAdd EVAL("var x='{{!URLCURRENT}}';x=x.split('place/')[1].split('/')[0];x.replace(/i/g, ' ');") PROMPT {{mAdd}}
Then, OK, I'll answer this one...
2 easier Solutions (than the one(s) on SOF)...:
Code: Select all
VERSION BUILD=8820413 RECORDER=FX
TAB T=1
'https://www.google.com/maps/place/126+Wisconsin+Ave,+Columbus,+OH+43222,+USA/@39.960997,-83.0353897,17z/data=!3m1!4b1!4m5!3m4!1s0x88388f0bcde7eead:0x4861119f539b0dd4!8m2!3d39.960997!4d-83.033201
'SET mAdd EVAL("var x='{{!URLCURRENT}}';x=x.split('place/')[1].split('/')[0];x.replace(/\+/g, ' ');")
SET mAdd EVAL("var u='{{!URLCURRENT}}'; var x,y,z; x=u.split('place/'); y=x[1].split('/'); z=y[0].split('+').join(' '); z;")
PROMPT _{{mAdd}}_
Code: Select all
VERSION BUILD=8820413 RECORDER=FX
TAB T=1
'https://www.google.com/maps/place/126+Wisconsin+Ave,+Columbus,+OH+43222,+USA/@39.960997,-83.0353897,17z/data=!3m1!4b1!4m5!3m4!1s0x88388f0bcde7eead:0x4861119f539b0dd4!8m2!3d39.960997!4d-83.033201
SET mAdd EVAL("var u='{{!URLCURRENT}}'; var x,y,z; x=u.split('/'); z=x[5].split('+').join(' '); z;")
PROMPT _{{mAdd}}_
(Tested on iMacros for FF v8.8.2, PM v26.3.3, Win10_x64.)_126 Wisconsin Ave, Columbus, OH 43222, USA_
Last edited by chivracq on Fri Sep 14, 2018 1:34 am, edited 1 time in total.
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Re: replace plus character with EVAL
Hum..., and if you prefer your Syntax, you simply need to double escape the '+' Sign...
This one works as well...:
And one more...:
Hum, and could you correct the ugly Typo in your Thread Title...?
(Nobody is going to search the Forum using "charcater" [sic!] as Keyword...! )
This one works as well...:
Code: Select all
SET mAdd EVAL("var x='{{!URLCURRENT}}';x=x.split('place/')[1].split('/')[0];x.replace(/\\+/g, ' ');")
PROMPT _{{mAdd}}_
Code: Select all
SET mAdd EVAL("var x='{{!URLCURRENT}}';x=x.split('place/')[1].split('/')[0];x.replace(/[+]/g, ' ');")
PROMPT _{{mAdd}}_
(Nobody is going to search the Forum using "charcater" [sic!] as Keyword...! )
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Re: replace plus charcater with EVAL
I got the data from other HTML TAG in mean time.
Available for custom iim, javascript iMacros scripts
Re: replace plus charcater with EVAL
Code: Select all
TAG POS=1 TYPE=META ATTR=itemprop:description EXTRACT=HTM
SET mAdd EVAL("var x='{{!EXTRACT}}';var pos1=x.indexOf('content=');var pos2=x.indexOf('itemprop',pos1);x.substr(pos1+9,pos2-pos1-11).trim();")
prompt {{mAdd}}
Available for custom iim, javascript iMacros scripts
Re: replace plus character with EVAL
techimac wrote:I got the data from other HTML TAG in mean time.
Foufff..., that's a very cumbersome and unreliable Workaround in my Opinion... And you are "lucky" that "they" didn't make a Typo in all that extra-redundant Meta-Data...techimac wrote:Code: Select all
TAG POS=1 TYPE=META ATTR=itemprop:description EXTRACT=HTM SET mAdd EVAL("var x='{{!EXTRACT}}';var pos1=x.indexOf('content=');var pos2=x.indexOf('itemprop',pos1);x.substr(pos1+9,pos2-pos1-11).trim();") prompt {{mAdd}}
And that's not really/exactly the Answer to your OP...
>>>
Hum, and don't bother at least acknowledging that you've seen my Replies, and confirmed that my (4) Solutions work... Expecting a mini-Thanks is probably too much asking, I reckon...
And don't bother either correcting the Typo in your Thread Title like I asked you...
[I was being "nice" to you @techimac in this Thread, I stopped answering your Threads several months ago if you've noticed..., this one was a bit of "a second chance", but hum..., I'm still not very-very "impressed"... Hum, at least you did a bit of Research this time, and you impressively shared your Solution, that's already a big Improvement, ah-ah... But OK, never mind...]
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Re: replace plus charcater with EVAL
Thanks a lot!
I have to do fast so found alternative till help comes.
I have to do fast so found alternative till help comes.
Available for custom iim, javascript iMacros scripts
Re: replace plus character with EVAL
Hum, Typo in Thread Title corrected... (not in any of all your other Posts, probably part of the "I have to do fast" Methodism, but never mind...), but OK, good enough...techimac wrote:Thanks a lot!
I have to do fast so found alternative till help comes.
Yeah well, "I have to do fast" is "ADHD Behaviour" and never works and has never worked in any Programming Language...!
ADHD/Quick Programmers (hum, and Testers a well) are a complete "pain in the ass" in the Programming Industry, => 5x/10x more Time and Energy is/are usually needed to solve their stupid Bugs afterwards than if they had taken a bit the Time to test their Program/Script a bit "correctly"...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...