How can i strip " | domain.com" text off my extract?

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
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
Post Reply
miltonbburke
Posts: 4
Joined: Thu Feb 11, 2016 2:12 pm

How can i strip " | domain.com" text off my extract?

Post by miltonbburke » Thu Feb 11, 2016 2:19 pm

Hello,

I want to strip " | domain.com" text out of my extract, can someone please help me out with this?

Current the Extract is : "Some Text | domain.com"
I want to delete the " | domain.com" part and SET "Some Text" as VAR1

Config Info : Firefox (44.0.2) / Windows 10 / iMacros V.8.9.6 for Firefox

Regards,
Milton
Last edited by miltonbburke on Fri Feb 12, 2016 1:06 pm, edited 1 time in total.
chivracq
Posts: 9308
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How can i strip " | domain.com" text off my extract?

Post by chivracq » Thu Feb 11, 2016 3:23 pm

miltonbburke wrote:Hello,

I want to strip " | domain.com" text out of my extract, can someone please help me out with this?

Current the Extract is : "Some Text | domain.com"
I want to delete the " | domain.com" part and SET "Some Text" as VAR1

Regards,
Milton
CIM...! :mrgreen:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
miltonbburke
Posts: 4
Joined: Thu Feb 11, 2016 2:12 pm

Re: How can i strip " | domain.com" text off my extract?

Post by miltonbburke » Fri Feb 12, 2016 1:06 pm

Config Info added ;) sorry for missing that out.
chivracq
Posts: 9308
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How can i strip " | domain.com" text off my extract?

Post by chivracq » Fri Feb 12, 2016 3:53 pm

miltonbburke wrote:Config Info added ;) sorry for missing that out.
Ah OK, good... Always mention your FCI when you open a Thread, I don't react otherwise normally...

But for your Qt, yep, fairly easy: Use 'EVAL()' with 'replace()' or 'split()', you'll find several Examples on the Forum... (and even on the Wiki Page for 'EVAL()'...)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
miltonbburke
Posts: 4
Joined: Thu Feb 11, 2016 2:12 pm

Re: How can i strip " | domain.com" text off my extract?

Post by miltonbburke » Fri Feb 12, 2016 4:00 pm

Can you please give me an example for above mentioned code?
i did read a few "EVAL()" method but they seems pretty confusing to me :P
chivracq
Posts: 9308
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How can i strip " | domain.com" text off my extract?

Post by chivracq » Fri Feb 12, 2016 5:11 pm

miltonbburke wrote:Can you please give me an example for above mentioned code?
i did read a few "EVAL()" method but they seems pretty confusing to me :P
Euh...!, I'll help you if you try your best and really get stuck, not to teach you how to type 2 or 3 Keywords in a Searchbox... :roll:

I've already produced many Examples, and even the Wiki has some Examples (but the ones in the Wiki are indeed maybe already a bit too complicated for your Need...).
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
IrishMacro
Posts: 135
Joined: Wed Nov 03, 2010 12:27 pm

Re: How can i strip " | domain.com" text off my extract?

Post by IrishMacro » Fri Feb 12, 2016 8:51 pm

Yeah, EVAL can be quite confusing. It's based on regex which isn't easy to use.
As an exmple, this will go to http://wiki.imacros.net/EVAL and tag "Random wait" and replaces "wait" with a space, leaving just "Random"

URL GOTO=http://wiki.imacros.net/EVAL
TAG POS=1 TYPE=H4 ATTR=TXT:Random<SP>wait EXTRACT=TXT
SET !VAR1 EVAL("var variable=\"{{!EXTRACT}}\"; variable.replace(/wait/g,''); ")
PROMPT {{!VAR1}}

There's probably a better way to do it but this could work for you
Firefox free plugin, last version
Win7
Post Reply