delete the last character in the variable
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
delete the last character in the variable
Hello,
I have a table with a gross amount with the sigle '€'.
I set the price in the VAR1, but it saves the sigle '€'. How to delete the last character?
I would like to do an operation with the price.
For example,
TAG POS=1 TYPE=TD ATTR=TXT:FR0000045072 EXTRACT=TXT
SET !VAR1 {{!EXTRACT}}
SET !EXTRACT NULL
TAG POS=R1 TYPE=TD ATTR=TXT:*€ EXTRACT=TXT
SET !VAR2 {{!EXTRACT}}
SET !EXTRACT NULL
ADD !VAR2 -0.01 => it's not possible because VAR2= 5.5€, i would like to have VAR2=5.5
Thanks for your help,
I have a table with a gross amount with the sigle '€'.
I set the price in the VAR1, but it saves the sigle '€'. How to delete the last character?
I would like to do an operation with the price.
For example,
TAG POS=1 TYPE=TD ATTR=TXT:FR0000045072 EXTRACT=TXT
SET !VAR1 {{!EXTRACT}}
SET !EXTRACT NULL
TAG POS=R1 TYPE=TD ATTR=TXT:*€ EXTRACT=TXT
SET !VAR2 {{!EXTRACT}}
SET !EXTRACT NULL
ADD !VAR2 -0.01 => it's not possible because VAR2= 5.5€, i would like to have VAR2=5.5
Thanks for your help,
Re: delete the last character in the variable
I think its ONly possible with Js
with substring
with substring
Re: delete the last character in the variable
Is it possible to use javascript with imacros?
So, i must to add:
VAR3 = VAR2.substring (0,VAR2.length-1) ???
is it OK?
So, i must to add:
VAR3 = VAR2.substring (0,VAR2.length-1) ???
is it OK?
Re: delete the last character in the variable
ok i add a file .js with:
var rechercher = iimPlay("essai1.iim")
var VAR3 = VAR2.substring (0,VAR2.length-1) + 1
But, when i open imacros in firefox, i select macro.js and click on the button "play" but none !!!
I think, it doesn't go to the file 'essai1.iim' but while?
var rechercher = iimPlay("essai1.iim")
var VAR3 = VAR2.substring (0,VAR2.length-1) + 1
But, when i open imacros in firefox, i select macro.js and click on the button "play" but none !!!
I think, it doesn't go to the file 'essai1.iim' but while?
-
- Posts: 3834
- Joined: Mon May 31, 2010 4:59 pm
Re: delete the last character in the variable
Hi pepsister,
You can use the EVAL command within your macro (.iim) code to evaluate Javascript statements for parsing data. The reference page has several examples.
You can use the EVAL command within your macro (.iim) code to evaluate Javascript statements for parsing data. The reference page has several examples.
Regards,
Tom, iMacros Support
Tom, iMacros Support
Re: delete the last character in the variable
thank you very much, it's ok now.
But i have a question again!
I would like to do several extract in the same macro, for example:
TAG POS=1 TYPE=TD ATTR=TXT:*€ EXTRACT=TXT
SET !VAR1 {{!EXTRACT}}
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:gbqf ATTR=ID:gbqfq CONTENT={{!VAR1}}
...
TAG POS=1 TYPE=TD ATTR=TXT:*€ EXTRACT=TXT [EXTRACT]
SET !VAR2 {{!EXTRACT}}
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:gbqf ATTR=ID:gbqfq CONTENT={{!VAR2}}
the popup after my SET !VAR1 line is: VAR1= 43,770 €
the popup after my SET !VAR2 line is: VAR2=67,530 €
but CONTENT={{!VAR2}} contains: 43,770 €[EXTRACT]67,530 €
I would like : CONTENT =67.530 € only.
Have you any ideas?
But i have a question again!
I would like to do several extract in the same macro, for example:
TAG POS=1 TYPE=TD ATTR=TXT:*€ EXTRACT=TXT
SET !VAR1 {{!EXTRACT}}
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:gbqf ATTR=ID:gbqfq CONTENT={{!VAR1}}
...
TAG POS=1 TYPE=TD ATTR=TXT:*€ EXTRACT=TXT [EXTRACT]
SET !VAR2 {{!EXTRACT}}
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:gbqf ATTR=ID:gbqfq CONTENT={{!VAR2}}
the popup after my SET !VAR1 line is: VAR1= 43,770 €
the popup after my SET !VAR2 line is: VAR2=67,530 €
but CONTENT={{!VAR2}} contains: 43,770 €[EXTRACT]67,530 €
I would like : CONTENT =67.530 € only.
Have you any ideas?
Re: delete the last character in the variable
usepepsister wrote:thank you very much, it's ok now.
But i have a question again!
I would like to do several extract in the same macro, for example:
TAG POS=1 TYPE=TD ATTR=TXT:*€ EXTRACT=TXT
SET !VAR1 {{!EXTRACT}}
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:gbqf ATTR=ID:gbqfq CONTENT={{!VAR1}}
...
TAG POS=1 TYPE=TD ATTR=TXT:*€ EXTRACT=TXT [EXTRACT]
SET !VAR2 {{!EXTRACT}}
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:gbqf ATTR=ID:gbqfq CONTENT={{!VAR2}}
the popup after my SET !VAR1 line is: VAR1= 43,770 €
the popup after my SET !VAR2 line is: VAR2=67,530 €
but CONTENT={{!VAR2}} contains: 43,770 €[EXTRACT]67,530 €
I would like : CONTENT =67.530 € only.
Have you any ideas?
Code: Select all
set !extract null
Get Best iMacros scripts at http://imacrosbot.com/