variable {{!colN}}

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 Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.
Post Reply
vajavaja16
Posts: 4
Joined: Thu May 03, 2018 1:29 pm

variable {{!colN}}

Post by vajavaja16 » Thu May 03, 2018 1:33 pm

I am creating Imacros bot to submit site in the directory. So I want to give {{!colN}} custom value
I have 2 CSV file, info.csv and category.csv files.
In file.csv i am writing a custom number for example 3, and want to fill a form with {{!col3}} from category.csv

What I tried

1 - {{!col{!col16}} This isn't working

2

set !var1 {{!col16}}
SET !var3 EVAL("var r='{{!var1}}'; var x='{{!col' + r + '}}'; x;")
PROMPT Var_N:<SP>_{{Var_N}}_{{!Var1}}
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:Address CONTENT={{!var3}}
This text writing {{!col3}} and not value from file

3) I used some javascript and my site to get back value

macro += "tab open" + "\n";
macro += "tab t=2" + "\n";
macro += "URL GOTO=http://example.com/email/gela.php/{{!col16}}" + "\n";
var url = window.location.pathname;
var id = url.substring(url.lastIndexOf('/') + 1);
macro += "tab close" + "\n";
macro += "tab t=1" + "\n";
But this code getting URL from the site where is was first. for example, home file is google.com and then redirect to example.com/email/gela.php/{{!col16}} this code take value from google.com

Do you have any idea I am working on it for 3 days
Pleaseeee........
chivracq
Posts: 7722
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: variable {{!colN}}

Post by chivracq » Thu May 03, 2018 2:13 pm

vajavaja16 wrote:I am creating Imacros bot to submit site in the directory. So I want to give {{!colN}} custom value
I have 2 CSV file, info.csv and category.csv files.
In file.csv i am writing a custom number for example 3, and want to fill a form with {{!col3}} from category.csv

What I tried

1 - {{!col{!col16}} This isn't working

2

Code: Select all

set !var1 {{!col16}}
SET !var3 EVAL("var r='{{!var1}}'; var x='{{!col' + r + '}}'; x;")
PROMPT Var_N:<SP>_{{Var_N}}_{{!Var1}}
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:Address CONTENT={{!var3}}
This text writing {{!col3}} and not value from file

3) I used some javascript and my site to get back value

Code: Select all

macro += "tab open" + "\n";
macro += "tab t=2" + "\n";
macro += "URL GOTO=http://example.com/email/gela.php/{{!col16}}" + "\n";
var url = window.location.pathname;
var id = url.substring(url.lastIndexOf('/') + 1);
macro += "tab close" + "\n";
macro += "tab t=1" + "\n";
But this code getting URL from the site where is was first. for example, home file is google.com and then redirect to example.com/email/gela.php/{{!col16}} this code take value from google.com

Do you have any idea I am working on it for 3 days
Pleaseeee........
Try to select the correct Sub-Forum when you open a Thread, your Qt has nothing to do with 'Data Extraction'... (Thread might be moved to the 'General' Sub-Forum "one day"... (But no need to open a Duplicate yourself...)) :roll:

(F)CIM...! :mrgreen: (Read my Sig...)

Well, no luck, "{{!COL{{!COL1}}" is indeed not supported in iMacros, all Versions, all Browsers...
I have it as an Enhancement Request here... (Item_14)
-14- Implement a "Super" Built-in Var that could contain Commands like 'OPEN' / 'CLOSE' / 'REFRESH' / 'CLEAR' / etc and other (Built-in) Vars like for example in '{{!COL{{!LOOP}}}}'.
If you search the Forum a bit, you'll find a Solution/Workaround in JS as you are using a '.js' Script where you can concatenate the "!COL"+"n" in Javascript, that works...
And there is another Workaround in pure '.iim' but that works as well only in FF, by "misusing" the '!DATASOURCE_DELIMITER' Command (which is only supported on FF) to retrieve a complete Row at once from your '.CSV', to then re-split that whole Row into an Array with its original Columns, and the Index within the Array corresponds to the original Cols/Cells.

For other Browsers than FF, you can still use more or less the same "Trick" but you then need to "format" your '.CSV' with one extra Col between all Cols containing some "fake" Delimiter for each Cell and each Row and to open that File as a '.TXT' File and not as a '.CSV'... But it's a bit cumbersome... And there are other Methods, using a Googlesheet or saving your '.CSV' as an '.HTML' File and identifying all Cols with a separate Colour etc..., but it then gets more and more cumbersome, ah-ah...! :twisted:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
vajavaja16
Posts: 4
Joined: Thu May 03, 2018 1:29 pm

Re: variable {{!colN}}

Post by vajavaja16 » Fri May 04, 2018 5:13 am

I research all post on this forum and stackoverflow and can't find solution.
can anyone helps me?
chivracq
Posts: 7722
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: variable {{!colN}}

Post by chivracq » Fri May 04, 2018 1:24 pm

vajavaja16 wrote:I research all post on this forum and stackoverflow and can't find solution.
can anyone helps me?
Hum..., "I research all post on this forum" sounds a bit like a "Joke", ah-ah...!, as you didn't even read my Reply..., in which I mentioned, among other things, NOT to open a Duplicate...!
And the first thing you do..., is create a Duplicate...! :roll: OK, fair enough, both Threads will eventually get merged or one will be deleted, which is always a bit of a hassle for the Forum Admin..., but this is always a "Show-killer" for me for (further) help Users... :roll:
Good luck with other Advanced Users..., and your Boss, oops...! :wink:
vajavaja16 wrote:Hello I am trying to solve this problem too much time and please help me
I promise my boss that I will do some bot but I have this problem

So i want to go on use varieble colN
I tryied everyithing I think

this code dont gives me value from

Code: Select all

VERSION BUILD=10.0.501.6698
TAB T=1
TAB CLOSEALLOTHERS
SET !DATASOURCE category.csv
SET !DATASOURCE_LINE 2
URL GOTO=http://xuxup.com/email/gela.php?id=2
TAG POS=1 TYPE=* ATTR=* EXTRACT=TXT
SET !VAR2 EVAL("var s=\"{{!EXTRACT}}\"; var x='{{!col' + s + '}}'; x;")
prompt {{!VAR2}}
This code is doing same, only gives me {{!col2}} and dont gives me value

Code: Select all

set !var1 {{!col16}}
SET !var3 EVAL("var r='{{!var1}}'; var x='{{!col' + r + '}}'; x;")
PROMPT Var_N:<SP>_{{Var_N}}_{{!Var1}}
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:Address CONTENT={{!var3}}
I tried this and this code takes url from home page.

Code: Select all

macro += "tab open" + "\n";
macro += "tab t=2" + "\n";
macro += "URL GOTO=http://example.com/email/gela.php/{{!col16}}" + "\n";
var url = window.location.pathname;
var id = url.substring(url.lastIndexOf('/') + 1);
macro += "tab close" + "\n";
macro += "tab t=1" + "\n";
I really need help, pleasee
+ For those interested, parallel Thread on SOF:
- Imacros variable column with JavaScript
(No Replies yet...)
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
vajavaja16
Posts: 4
Joined: Thu May 03, 2018 1:29 pm

Re: variable {{!colN}}

Post by vajavaja16 » Sun May 06, 2018 6:37 pm

I still can't find solution
Post Reply