Tamilselvan wrote: ↑Thu Sep 16, 2021 11:05 am
my 1st extracted word is
1st Extr.jpg
and 2nd is
2nd Extract.jpg
Now i have changed both..
Code: Select all
SAVEAS TYPE=HTM FOLDER=E:\Pt-Fto\ FILE={{Pt_name}}{{Fto_no}}.htm
File name saved in folder as below (Sathapoondi)TN2906015_010421FTO_1238
.... I want to remove both '(' ,')' .
Alright, this is good/better already...!
>
Then hum, what you call "my 1st/2nd extracted word" is for both already the Result of the 'EVAL()' Statements, => the "Output", but "'EXTRACT"' / "extracted" is the "Input", and I still miss that Info...
=> A "better" way to use the 'PROMPT' for Debug Purpose, (even if I'm already very pleased to see that you are using 'PROMPT' to debug your 'EVAL()' Statements, and you also use "my" Syntax in 'EVAL()', very good...!
), is to display both the "original" 'EXTRACT' + the Result of your 'EVAL()', and each time mentioning the Name of your Var, + surrounding all Vars with some Delimiter (I usually use "_") to make sure that all (Soft) Tabs/Returns/Spaces are also visible, same also if the Var only contains an empty String...:
Code: Select all
PROMPT EXTRACT:<BR>_{{!EXTRACT}}_<BR><BR>Pt_name:<BR>_{{Pt_name}}_
... And you can do the same for the 'PROMPT' corresponding to your your 'Fto_no' Var...
>
Oh yeah...!, and one "Detail", when displaying Vars in the 'PROMPT', I always remove the "!" Char from Built-in Vars in the Text Name of the Var (=> for '!EXTRACT' or '!VAR1'/'!VAR2'/etc), or iMacros "thinks" you want to use an "Input PROMPT" instead of a "Display PROMPT"...
>>>
Tamilselvan wrote: ↑Thu Sep 16, 2021 11:05 am
Code: Select all
VERSION BUILD=8970419 RECORDER=FX
TAB T=1
'URL GOTO=https://mnregaweb2.nic.in/netnrega/FTO/fto_sign_detail.aspx?lflag=local&flg=W&page=b&state_name=%e0%ae%a4%e0%ae%ae%e0%ae%bf%e0%ae%b4%e0%af%8d%e0%ae%a8%e0%ae%be%e0%ae%9f%e0%af%81&state_code=29&district_name=%e0%ae%a4%e0%ae%bf%e0%ae%b0%e0%af%81%e0%ae%b5%e0%ae%a3%e0%af%8d%e0%ae%a3%e0%ae%be%e0%ae%ae%e0%ae%b2%e0%af%88&district_code=2906&block_name=Thellar&block_code=2906015&fin_year=2021-2022&typ=fst_sig&mode=b&source=&Digest=h6f9h6YyIpuMzlkCjaGneQ
SET !LOOP 2
EVENT TYPE=CLICK SELECTOR="#form1>DIV:nth-of-type(3)>TABLE:nth-of-type(4)>TBODY>TR:nth-of-type({{!LOOP}})>TD:nth-of-type(2)>A" BUTTON=0 MODIFIERS="ctrl"
TAB T=2
SET !EXTRACT_TEST_POPUP NO
SET !EXTRACT NULL
' Extract Panchayat Name
'TAG POS=1 TYPE=TD ATTR=TXT:TN-06-015-043-043/559-A<SP>(Sathapoondi) EXTRACT=TXT
TAG POS=1 TYPE=TD ATTR=TXT:TN-06-015-* EXTRACT=TXT
SET Pt_name {{!EXTRACT}}
SET Pt_name EVAL("var s='{{!EXTRACT}}'; var x,y,z; x=s.indexOf('('); y=s.substring(x).trim()+ s.indexOf(')'); y=s.substring(x).trim();if(x<0){z='No Name';} else{z=y;}; z;")
PROMPT {{Pt_name}}
SET !EXTRACT NULL
' Extract FTO No.
'TAG POS=1 TYPE=B ATTR=TXT:Fto<SP>No.<SP>:<SP>TN2906015_010421FTO_1238 EXTRACT=TXT
TAG POS=1 TYPE=B ATTR=TXT:Fto<SP>No.<SP>:<SP>TN2906015_* EXTRACT=TXT
SET Fto_no EVAL("var s='{{!EXTRACT}}'; var x,y,z; x=s.indexOf('T'); y=s.substr(x); if(x<0){z='No FTO';} else{z=y;};z;")
PROMPT {{Fto_no}}
SAVEAS TYPE=HTM FOLDER=E:\Pt-Fto\ FILE={{Pt_name}}{{Fto_no}}.htm
where i have to change my code ... to find last word...
Code: Select all
SET Pt_name EVAL("var s='{{!EXTRACT}}'; var x,y,z; x=s.indexOf('('); y=s.substring(x).trim()+ s.indexOf(')'); y=s.substring(x).trim();if(x<0){z='No Name';} else{z=y;}; z;")
=> Hum, OK...:
Code: Select all
x=s.indexOf('('); y=s.substring(x).trim()+ s.indexOf(')'); y=s.substring(x).trim();
Well, the "Purpose" of using 'substring()' is to use both Indexes in just one same 'substring()' Command, the
Syntax of that JS Method is:
Code: Select all
[Input_String].substring([Start_Index],[End_Index])
And "Start_Index" will be "indexOf('(')+1" and "End_Index" will be "indexOf(')')-1", I would think, well, control yourself if the "+/-1" are correct for both Indexes, and adjust accordingly if needed...
And that would give for the whole 'EVAL()' stg like:
Code: Select all
SET Pt_name EVAL("var s='{{!EXTRACT}}'; var x,y,z; x=s.indexOf('('); y=s.indexOf(')'); if(x<0){z='No Name';} else{z=s.substring(x+1,y-1);}; z;")
PROMPT EXTRACT:<BR>_{{!EXTRACT}}_<BR><BR>Pt_name:<BR>_{{Pt_name}}_
- (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...