How to remove "US$"1.92 I need only the number.

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.
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
Roto
Posts: 5
Joined: Sat Jan 18, 2014 12:14 am

How to remove "US$"1.92 I need only the number.

Post by Roto » Sat Jan 18, 2014 12:52 am

hi friends. I'm a little tired looking information to fix this problem :roll: I need to remove this "US$ "

this is my code:

Code: Select all

VERSION BUILD=8601111 RECORDER=FX
TAB T=1
TAB T=2
SET !EXTRACT_TEST_POPUP NO
TAG POS=7 TYPE=TD ATTR=TXT:* EXTRACT=TXT 
SET !CLIPBOARD {{!EXTRACT}}
TAB T=1
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:form ATTR=ID:elm_price_price CONTENT={{!CLIPBOARD}}
TAG POS=1 TYPE=A ATTR=TXT:Quantity<SP>discounts
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:form ATTR=NAME:product_data[prices][1][price] CONTENT={{!CLIPBOARD}}
I need only the number. like: 2.88
not: US$ 2.88 ✖

thank you so much for your help.
User avatar
cybmatrix
Posts: 38
Joined: Tue Dec 08, 2009 8:33 pm

Me too > I need only the numbers.

Post by cybmatrix » Tue Jan 21, 2014 1:45 am

I've the same problem ...

The data extracted is in this format > PHONE NUMBER : 00112233
I need to filter only numbers, without spaces and words.

I think the parameter EVAL would solve this issue, but I don't know anything about Javascript code !!
PLEASE HELP.
Windows 7 PRO (64 bit)
Waterfox 51.0.1 (64 bit)
iMacros for FF 8.9.7
chivracq
Posts: 9516
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Me too > I need only the numbers.

Post by chivracq » Wed Jan 22, 2014 1:16 am

cybmatrix wrote:I've the same problem ...

The data extracted is in this format > PHONE NUMBER : 00112233
I need to filter only numbers, without spaces and words.

I think the parameter EVAL would solve this issue, but I don't know anything about Javascript code !!
PLEASE HELP.
No need to spam the Forum and to ask the same Question 3 times in 3 different Threads!

Roto did the same (only twice...), now look for my Answer to Roto's other Thread and mention (in the other Thread) the URL of the Page you are trying to interact with if you want me to give you a more precise Answer...
- (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...
User avatar
cybmatrix
Posts: 38
Joined: Tue Dec 08, 2009 8:33 pm

Re: How to remove "US$"1.92 I need only the number.

Post by cybmatrix » Wed Jan 22, 2014 3:02 am

I'm sorry for the spam.

What I need is only the javascript code to filter any word\symbol from the extracted text and keep only numbers.
I've found a solution, with others Eval scripts found on the forum, but sometimes they don't work correctly.

Code: Select all

SET !VAR1 EVAL("var s=\"{{!EXTRACT}}\"; s.replace( ?????????????????????????? )
--------------------

I think that for me would be much more simplier to use the param SEARCH cause data format is : PHONE NUMBER : 123456789
So I only need to set a regular expression the way imacros will try to find ( PHONE NUMBER : ) and then extract only the following numbers.

Example :

Code: Select all

SEARCH SOURCE=REGEXP:" ????????????? " EXTRACT=$1
Please help me with this code and thank you for your time.
Post Reply