How to set column ?

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
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
Post Reply
anggun123
Posts: 55
Joined: Tue Aug 03, 2021 2:39 pm

How to set column ?

Post by anggun123 » Sat Aug 14, 2021 7:51 pm

Code: Select all


Browser Firefox 48.0
iMacros for Firefox 8.9.7
Windows 10 32-bit Operating system
how to set first column in imcros ? i want the first extract result in column 100... by default the first column is in column 1
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to set column ?

Post by chivracq » Sat Aug 14, 2021 8:54 pm

anggun123 wrote:
Sat Aug 14, 2021 7:51 pm

Code: Select all

Browser Firefox 48.0
iMacros for Firefox 8.9.7
Windows 10 32-bit Operating system
how to set first column in imcros ? i want the first extract result in column 100... by default the first column is in column 1

Yep, easy, but I already gave you the "Answer" in your previous Thread, seems like you didn't really understand it then... :o

Code: Select all

'TAG POS=1 TYPE=DIV ATTR=TXT:Your_Real_Extract EXTRACT=TXT
SET !EXTRACT Your_Real_Extract
SET Real_Extract {{!EXTRACT}}

SET !EXTRACT [EXTRACT][EXTRACT][EXTRACT]...etc...=>x98_times_in_total...![EXTRACT]
ADD !EXTRACT {{Real_Extract}}
SAVEAS TYPE=EXTRACT FOLDER=* FILE=Your_File_[!NOW:yyyy-mm-dd_hh:nn].csv
- (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...
anggun123
Posts: 55
Joined: Tue Aug 03, 2021 2:39 pm

Re: How to set column ?

Post by anggun123 » Sat Aug 14, 2021 9:07 pm

understand just a little :D

is there a way without having to write
SET !EXTRACT [EXTRACT][EXTRACT][EXTRACT] [extraxt] to =>98
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to set column ?

Post by chivracq » Sat Aug 14, 2021 9:16 pm

anggun123 wrote:
Sat Aug 14, 2021 9:07 pm
understand just a little :D

is there a way without having to write
SET !EXTRACT [EXTRACT][EXTRACT][EXTRACT] [extraxt] to =>98

Yep...! 8) :P

Code: Select all

SET !EXTRACT ""
ADD !EXTRACT ""
ADD !EXTRACT ""
'=> Repeat x98 times in total...!
'>
ADD !EXTRACT {{Real_Extract}}
- (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...
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to set column ?

Post by chivracq » Sat Aug 14, 2021 9:24 pm

But yep, a bit "more seriously" :P , => using 'EVAL()' and a 'for' Loop, you could construct the "[EXTRACT]x98" String... :idea:

You were "originally" using a '.js' Script, so you are the JS Specialist...! :wink:
- (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...
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to set column ?

Post by chivracq » Sat Aug 14, 2021 9:40 pm

Another "funny" (and though quite simple) Implementation would be: :twisted:

Code: Select all

SET 9x_E [EXTRACT][EXTRACT][EXTRACT][EXTRACT][EXTRACT][EXTRACT][EXTRACT][EXTRACT][EXTRACT]
SET 99x_E {{9x_E}}{{9x_E}}{{9x_E}}{{9x_E}}{{9x_E}}{{9x_E}}{{9x_E}}{{9x_E}}{{9x_E}}{{9x_E}}{{9x_E}}
SET !EXTRACT {{99x_E}}{{Real_Extract}}
It is just a "simple" Maths Pb, many-many Solutions... :wink:
- (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...
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to set column ?

Post by chivracq » Sat Aug 14, 2021 10:10 pm

And another "funny" one: :P

Code: Select all

SET 98x_# ##################################################################################################
SET 98x_E EVAL("var 98#='{{98x_#}}'; var z=98#.split('#').join('[EXTRACT]'); z;")
SET !EXTRACT {{98x_E}}
ADD !EXTRACT {{Real_Extract}}
- (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...
anggun123
Posts: 55
Joined: Tue Aug 03, 2021 2:39 pm

Re: How to set column ?

Post by anggun123 » Sun Aug 15, 2021 7:30 am

chivracq wrote:
Sat Aug 14, 2021 9:24 pm
But yep, a bit "more seriously" :P , => using 'EVAL()' and a 'for' Loop, you could construct the "[EXTRACT]x98" String... :idea:

You were "originally" using a '.js' Script, so you are the JS Specialist...! :wink:
can only convert Js Script :D :D
anggun123
Posts: 55
Joined: Tue Aug 03, 2021 2:39 pm

Re: How to set column ?

Post by anggun123 » Sun Aug 15, 2021 7:32 am

chivracq wrote:
Sat Aug 14, 2021 9:40 pm
Another "funny" (and though quite simple) Implementation would be: :twisted:

Code: Select all

SET 9x_E [EXTRACT][EXTRACT][EXTRACT][EXTRACT][EXTRACT][EXTRACT][EXTRACT][EXTRACT][EXTRACT]
SET 99x_E {{9x_E}}{{9x_E}}{{9x_E}}{{9x_E}}{{9x_E}}{{9x_E}}{{9x_E}}{{9x_E}}{{9x_E}}{{9x_E}}{{9x_E}}
SET !EXTRACT {{99x_E}}{{Real_Extract}}
It is just a "simple" Maths Pb, many-many Solutions... :wink:
thank you very much sir
it works :) :)
anggun123
Posts: 55
Joined: Tue Aug 03, 2021 2:39 pm

Re: How to set column ?

Post by anggun123 » Sun Aug 15, 2021 7:35 am

chivracq wrote:
Sat Aug 14, 2021 10:10 pm
And another "funny" one: :P

Code: Select all

SET 98x_# ##################################################################################################
SET 98x_E EVAL("var 98#='{{98x_#}}'; var z=98#.split('#').join('[EXTRACT]'); z;")
SET !EXTRACT {{98x_E}}
ADD !EXTRACT {{Real_Extract}}
SyntaxError: missing variable name, line 10 (Error code: -1001)

Code: Select all

SET 98x_E EVAL("var 98#='{{98x_#}}'; var z=98#.split('#').join('[EXTRACT]'); z;")
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to set column ?

Post by chivracq » Sun Aug 15, 2021 3:17 pm

anggun123 wrote:
Sun Aug 15, 2021 7:35 am
chivracq wrote:
Sat Aug 14, 2021 10:10 pm
And another "funny" one: :P

Code: Select all

SET 98x_# ##################################################################################################
SET 98x_E EVAL("var 98#='{{98x_#}}'; var z=98#.split('#').join('[EXTRACT]'); z;")
SET !EXTRACT {{98x_E}}
ADD !EXTRACT {{Real_Extract}}
SyntaxError: missing variable name, line 10 (Error code: -1001)

Code: Select all

SET 98x_E EVAL("var 98#='{{98x_#}}'; var z=98#.split('#').join('[EXTRACT]'); z;")

Hum, yep indeed, I can reproduce, strange...! :o , looks like Vars declared inside 'EVAL()' are not allowed to start with a Digit, so the "98#" Var is causing that "Syntax" Error..., and simply changing a bit the Name of that Var then works correctly... ("98#" => "Sep"):

Code: Select all

SET Real_Extract "Your real Extract in Col_100...!"

SET 98x_# ##################################################################################################
SET 98x_E EVAL("var Sep='{{98x_#}}'; var z=Sep.split('#').join('[EXTRACT]'); z;")
SET !EXTRACT {{98x_E}}
ADD !EXTRACT {{Real_Extract}}

PROMPT Real_Extract:<SP>_{{Real_Extract}}_<BR><BR>EXTRACT:<BR>_{{!EXTRACT}}_
PAUSE
(Tested in iMacros for FF v8.8.2, PM v26.3.3, Win10_x64.)

I'm nearly surprised that in the 1000's of 'EVAL()' Statements I've already written :twisted: , I never came across that one, ah-ah...! :o

In that "Logic", it is then also nearly strange that 'EVAL()' doesn't complain about the iMacros User-Defined Var that I called "98x_#" and which is also used in the same 'EVAL()'...! :o
=> This one also works, if you prefer...:

Code: Select all

SET 98x_E EVAL("'{{98x_#}}'.split('#').join('[EXTRACT]');")
- (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...
anggun123
Posts: 55
Joined: Tue Aug 03, 2021 2:39 pm

Re: How to set column ?

Post by anggun123 » Tue Aug 17, 2021 3:08 am

thank you , it works

Code: Select all

SET 98x_# ##################################################################################################
SET 98x_E EVAL("'{{98x_#}}'.split('#').join('[EXTRACT]');")
SET !EXTRACT {{98x_E}}
ADD !EXTRACT {{!var1}}
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to set column ?

Post by chivracq » Tue Aug 17, 2021 3:20 am

anggun123 wrote:
Tue Aug 17, 2021 3:08 am
thank you , it works

Code: Select all

SET 98x_# ##################################################################################################
SET 98x_E EVAL("'{{98x_#}}'.split('#').join('[EXTRACT]');")
SET !EXTRACT {{98x_E}}
ADD !EXTRACT {{!var1}}

Ah...!?, OK, alright, Thanks for the Feedback then... :D

And hum, mini-Advice, the Syntax i used in "EVAL("'{{98x_#}}'.split('#').join('[EXTRACT]');")" is very simplified, => at "your Level", you can better use the Syntax I used in "EVAL("var Sep='{{98x_#}}'; var z=Sep.split('#').join('[EXTRACT]'); z;")" which is much easier to debug "in case of problem" (= "Result not completely as expected, ah-ah...!")...
(And even for myself, I never used this simplified Syntax, just saying...)
- (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...
Post Reply