Version 9.0.3
Windows 10
Firefox 50.1.0
Sir,
I extract data from csv. file. contain few digits.
csv.file :
/87-
/90-
/482-
/77-
/85-
/279-
/489-
/285-
Using It extracted from drop down list and compare the both csv.file & extracted.
In drop down list different from extracted text (i.e. index value extracted )
So i could not use #EANF# method.
Some time extracted text vary. (i.e. index value length)
so depends upon csv file length. compare extracted text. In mean time I am using String function. I get following error.
"VAR4 is not defined, line: 26 (Error code: -1001)"
Kindly do the needful.
Here is the code :
VERSION BUILD=9030808 RECORDER=FX
TAB T=1
SET !DATASOURCE "C:\\Users\\OFFICE\\Documents\\iMacros\\Datasources\\JobCard-No.csv"
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}
'Select Beneficiary Job Card No.
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_DDL_Registration CONTENT=%*{{!COL1}}*
WAIT SECONDS=1
SET !EXTRACT NULL
'Extract your Element:
TAG POS=1 TYPE=SELECT ATTR=NAME:ctl00$ContentPlaceHolder1$DDL_Registration EXTRACT=TXT
SET !VAR1 EVAL("var s=\"{{!COL1}}\"; s.length")
PROMPT {{!EXTRACT}}
SET !VAR3 18
SET !VAR4 !VAR3 s.toString()
SET !VAR5 !VAR1.toString()
SET !Sub_Str1 EVAL("var s=\"{{!EXTRACT}}\"; s.substr(VAR4,VAR5)")
PROMPT {{!Sub_Str1}}
'Spit out a "1" or "2" to reuse for "TAB T=n":
SET TAB_Nb EVAL("var s='{{Sub_Str1}}'; var z; if(s=='{{!COL1}}'){z=1;} else{z=2;}; z;")
'Stay on TAB_1 if Element found or switch to TAB_2 if not found:
TAB OPEN
TAB T={{TAB_Nb}}
Extract Data Using csv. & String Fn. Open Multi Tab
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
-
- Posts: 129
- Joined: Mon Mar 07, 2016 10:49 am
Re: Extract Data Using csv. & String Fn. Open Multi Tab
Okay..., I guess your Line 26 is this one:Tamilselvan wrote:Sir,Code: Select all
Version 9.0.3 Windows 10 Firefox 50.1.0
I extract data from csv. file. contain few digits.
csv.file :Using It extracted from drop down list and compare the both csv.file & extracted.Code: Select all
/87- /90- /482- /77- /85- /279- /489- /285-
In drop down list different from extracted text (i.e. index value extracted ) So i could not use #EANF# method.
Some time extracted text vary. (i.e. index value length) so depends upon csv file length. compare extracted text. In mean time I am using String function. I get following error.Kindly do the needful.Code: Select all
"VAR4 is not defined, line: 26 (Error code: -1001)"
Here is the code :Code: Select all
VERSION BUILD=9030808 RECORDER=FX TAB T=1 SET !DATASOURCE "C:\\Users\\OFFICE\\Documents\\iMacros\\Datasources\\JobCard-No.csv" SET !LOOP 2 SET !DATASOURCE_LINE {{!LOOP}} 'Select Beneficiary Job Card No. TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_DDL_Registration CONTENT=%*{{!COL1}}* WAIT SECONDS=1 SET !EXTRACT NULL 'Extract your Element: TAG POS=1 TYPE=SELECT ATTR=NAME:ctl00$ContentPlaceHolder1$DDL_Registration EXTRACT=TXT SET !VAR1 EVAL("var s=\"{{!COL1}}\"; s.length") PROMPT {{!EXTRACT}} SET !VAR3 18 SET !VAR4 !VAR3 s.toString() SET !VAR5 !VAR1.toString() SET !Sub_Str1 EVAL("var s=\"{{!EXTRACT}}\"; s.substr(VAR4,VAR5)") PROMPT {{!Sub_Str1}} 'Spit out a "1" or "2" to reuse for "TAB T=n": SET TAB_Nb EVAL("var s='{{Sub_Str1}}'; var z; if(s=='{{!COL1}}'){z=1;} else{z=2;}; z;") 'Stay on TAB_1 if Element found or switch to TAB_2 if not found: TAB OPEN TAB T={{TAB_Nb}}
Code: Select all
SET !Sub_Str1 EVAL("var s=\"{{!EXTRACT}}\"; s.substr(VAR4,VAR5)")
Code: Select all
SET Sub_Str1 EVAL("var s=\"{{!EXTRACT}}\"; s.substr('{{!VAR4}}','{{!VAR5}}')")
PROMPT {{!Sub_Str1}}
Code: Select all
SET Sub_Str1 EVAL("var s='{{!EXTRACT}}'; var v4='{{!VAR4}}', v5='{{!VAR5}}'; var z; z=s.substr(v4,v5); z;")
PROMPT {{Sub_Str1}}
But the way you try to define '!VAR4' and '!VAR5' a bit earlier in your Script looks "strange" to me as well...:
Code: Select all
SET !VAR4 !VAR3 s.toString()
SET !VAR5 !VAR1.toString()
Code: Select all
SET Sub_Str1 EVAL("var s='{{!EXTRACT}}'; var v4='{{!VAR3}}'.toString(), v5='{{!VAR1}}'.toString(); var z; z=s.substr(v4,v5); z;")
PROMPT {{Sub_Str1}}
- (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...
-
- Posts: 129
- Joined: Mon Mar 07, 2016 10:49 am
Re: Extract Data Using csv. & String Fn. Open Multi Tab
Worked perfectly !!!
Thank You Very much!
I need one more help.
when both the values are same, it works current tab only.
{!COL1}} and {{Sub_Str1}}
else another tab has moved and returned current tab.
it shows that the value (i.e. csv.file next content) is not available.
Entry [*/1-*] not available [Box has 126 entries], line: 13 (Error code: -924)
I need, if does not match, then move another tab once again repeat the task find and extract text
VERSION BUILD=9030808 RECORDER=FX
TAB T=1
SET !DATASOURCE "C:\\Users\\OFFICE\\Documents\\iMacros\\Datasources\\JobCard-No.csv"
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}
'Select Beneficiary Job Card No.
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_DDL_Registration CONTENT=%*{{!COL1}}*
WAIT SECONDS=1
SET !EXTRACT NULL
'Extract your Element:
TAG POS=1 TYPE=SELECT ATTR=NAME:ctl00$ContentPlaceHolder1$DDL_Registration EXTRACT=TXT
SET !VAR1 EVAL("var s=\"{{!COL1}}\"; s.length")
PROMPT {{!EXTRACT}}
SET !VAR3 17
PROMPT {{!COL1}}
PROMPT {{!VAR1}}
SET Sub_Str1 EVAL("var s='{{!EXTRACT}}'; var v4='{{!VAR3}}'.toString(), v5='{{!VAR1}}'.toString(); var z; z=s.substr(v4,v5); z;")
PROMPT {{Sub_Str1}}
'Spit out a "1" or "2" to reuse for "TAB T=n":
SET TAB_Nb EVAL("var s='{{Sub_Str1}}'; var z; if(s=='{{COL1}}'){z=1;} else{z=2;}; z;")
'Stay on TAB_1 if Element found or switch to TAB_2 if not found:
'TAB OPEN
TAB T={{TAB_Nb}}
I tried this method also
VERSION BUILD=9030808 RECORDER=FX
TAB T=1
SET !DATASOURCE "C:\\Users\\OFFICE\\Documents\\iMacros\\Datasources\\JobCard-No.csv"
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_DDL_Registration CONTENT=%*{{!COL1}}*
WAIT SECONDS=1
'Spit out a "1" or "2" to reuse for "TAB T=n":
SET TAB_Nb EVAL("var s='{{COL1}}'; var z; if(s!='#EANF#'){z=1;} else{z=2;}; z;")
'Stay on TAB_1 if Element found or switch to TAB_2 if not found:
TAB T={{TAB_Nb}}
same error shown. .
when both the values are same, it works current tab only. (i.e) {!COL1}} = {{Sub_Str1}}
else another tab has moved and returned quickly to current tab.
I think while moving another tab consider as tab t=1. so that its show error
Entry [*/1-*] not available [Box has 126 entries], line: 13 (Error code: -924)
Thank You Very much!
I need one more help.
when both the values are same, it works current tab only.
{!COL1}} and {{Sub_Str1}}
else another tab has moved and returned current tab.
it shows that the value (i.e. csv.file next content) is not available.
Entry [*/1-*] not available [Box has 126 entries], line: 13 (Error code: -924)
I need, if does not match, then move another tab once again repeat the task find and extract text
VERSION BUILD=9030808 RECORDER=FX
TAB T=1
SET !DATASOURCE "C:\\Users\\OFFICE\\Documents\\iMacros\\Datasources\\JobCard-No.csv"
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}
'Select Beneficiary Job Card No.
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_DDL_Registration CONTENT=%*{{!COL1}}*
WAIT SECONDS=1
SET !EXTRACT NULL
'Extract your Element:
TAG POS=1 TYPE=SELECT ATTR=NAME:ctl00$ContentPlaceHolder1$DDL_Registration EXTRACT=TXT
SET !VAR1 EVAL("var s=\"{{!COL1}}\"; s.length")
PROMPT {{!EXTRACT}}
SET !VAR3 17
PROMPT {{!COL1}}
PROMPT {{!VAR1}}
SET Sub_Str1 EVAL("var s='{{!EXTRACT}}'; var v4='{{!VAR3}}'.toString(), v5='{{!VAR1}}'.toString(); var z; z=s.substr(v4,v5); z;")
PROMPT {{Sub_Str1}}
'Spit out a "1" or "2" to reuse for "TAB T=n":
SET TAB_Nb EVAL("var s='{{Sub_Str1}}'; var z; if(s=='{{COL1}}'){z=1;} else{z=2;}; z;")
'Stay on TAB_1 if Element found or switch to TAB_2 if not found:
'TAB OPEN
TAB T={{TAB_Nb}}
I tried this method also
VERSION BUILD=9030808 RECORDER=FX
TAB T=1
SET !DATASOURCE "C:\\Users\\OFFICE\\Documents\\iMacros\\Datasources\\JobCard-No.csv"
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_DDL_Registration CONTENT=%*{{!COL1}}*
WAIT SECONDS=1
'Spit out a "1" or "2" to reuse for "TAB T=n":
SET TAB_Nb EVAL("var s='{{COL1}}'; var z; if(s!='#EANF#'){z=1;} else{z=2;}; z;")
'Stay on TAB_1 if Element found or switch to TAB_2 if not found:
TAB T={{TAB_Nb}}
same error shown. .
when both the values are same, it works current tab only. (i.e) {!COL1}} = {{Sub_Str1}}
else another tab has moved and returned quickly to current tab.
I think while moving another tab consider as tab t=1. so that its show error
Entry [*/1-*] not available [Box has 126 entries], line: 13 (Error code: -924)
-
- Posts: 129
- Joined: Mon Mar 07, 2016 10:49 am
Re: Extract Data Using csv. & String Fn. Open Multi Tab
May I Use GOTO Line / GOTO Tab option?