Easy and Fast way to update {{!COLX}} values in macro

Discussions and Tech Support specific to the iMacros Firefox add-on.
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
provoquestosito
Posts: 78
Joined: Sat Jan 30, 2010 12:43 am

Easy and Fast way to update {{!COLX}} values in macro

Post by provoquestosito » Thu Jul 18, 2019 6:28 pm

Hi

I have imacros 8.9.7 with firefox 52 ESR and windows 7.

I search a fast and easy way to update the {{!COL1}} values in my macro.

This is an example of my macro code

Code: Select all

TAG POS=1 TYPE=LABEL FORM=ID:post ATTR=TXT:{{!COL16}}
TAG POS=1 TYPE=LABEL FORM=ID:post ATTR=TXT:{{!COL17}}
TAG POS=1 TYPE=LABEL FORM=ID:post ATTR=TXT:{{!COL18}}
TAG POS=1 TYPE=LABEL FORM=ID:post ATTR=TXT:{{!COL19}}
TAG POS=1 TYPE=LABEL FORM=ID:post ATTR=TXT:{{!COL20}}
TAG POS=1 TYPE=LABEL FORM=ID:post ATTR=TXT:{{!COL21}}
If, for example, I had 1000 columns to specify in the code, is there a simpler and faster solution compared to writing them manually ?

I'm looking for a simple and quick solution to be able to write column variables quickly and be able to manage them unlimited.

Thanks
provoquestosito
Posts: 78
Joined: Sat Jan 30, 2010 12:43 am

Re: Easy and Fast way to update {{!COLX}} values in macro

Post by provoquestosito » Thu Jul 18, 2019 6:42 pm

For tag pos i find a solution like this

Code: Select all


SET Pos 0

ADD Pos 1
TAG POS={{Pos}} TYPE=TD ATTR=TXT:Type

ADD Pos 1
TAG POS={{Pos}} TYPE=TD ATTR=TXT:Type

ADD Pos 1
TAG POS={{Pos}} TYPE=TD ATTR=TXT:Type

ADD Pos 1
TAG POS={{Pos}} TYPE=TD ATTR=TXT:Type

For Pos from 1 to 4 it's very fast to copy and paste.

I'm searching a similar solution to update {{!COLX}} values

Thanks
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Easy and Fast way to update {{!COLX}} values in macro

Post by chivracq » Thu Jul 18, 2019 6:51 pm

provoquestosito wrote:
Thu Jul 18, 2019 6:28 pm
Hi

I have

Code: Select all

imacros 8.9.7 with firefox 52 ESR and windows 7.
I search a fast and easy way to update the {{!COL1}} values in my macro.

This is an example of my macro code

Code: Select all

TAG POS=1 TYPE=LABEL FORM=ID:post ATTR=TXT:{{!COL16}}
TAG POS=1 TYPE=LABEL FORM=ID:post ATTR=TXT:{{!COL17}}
TAG POS=1 TYPE=LABEL FORM=ID:post ATTR=TXT:{{!COL18}}
TAG POS=1 TYPE=LABEL FORM=ID:post ATTR=TXT:{{!COL19}}
TAG POS=1 TYPE=LABEL FORM=ID:post ATTR=TXT:{{!COL20}}
TAG POS=1 TYPE=LABEL FORM=ID:post ATTR=TXT:{{!COL21}}
If, for example, I had 1000 columns to specify in the code, is there a simpler and faster solution compared to writing them manually ?

I'm looking for a simple and quick solution to be able to write column variables quickly and be able to manage them unlimited.

Thanks

Yep there is, hum, are actually, one in '.js' as you are on v8.9.7 for FF, where you can concatenate the '!COLn' as '!COL' + 'n' as a String, and a "more powerful" one, I would think, in pure '.iim' by simply "misusing" the '!DATASOURCE_DELIMITER' Command, and changing it temporarily to some "fake" Separator to extract a complete Row with just one single '{{!COL1}}' and using 'EVAL()' + 'split()', you re-split that whole Row into all Cols... 8)
(Index starts at "0" for 'split()'...)

I never tested though about "Speed" as you are talking about 1000 Cols. It's "instant" for about 20 Cols, I don't know for 1000 Cols...

And I also have an EnhReq about that, that you are 'encouraged' to support...!: :wink:
- Re: List of EnhReq's...!! [by @chivracq]
=> About Item_14, the "Super Built-in Var"...! :twisted:

provoquestosito wrote:
Thu Jul 18, 2019 6:42 pm
For tag pos i find a solution like this

Code: Select all


SET Pos 0

ADD Pos 1
TAG POS={{Pos}} TYPE=TD ATTR=TXT:Type

ADD Pos 1
TAG POS={{Pos}} TYPE=TD ATTR=TXT:Type

ADD Pos 1
TAG POS={{Pos}} TYPE=TD ATTR=TXT:Type

ADD Pos 1
TAG POS={{Pos}} TYPE=TD ATTR=TXT:Type

For Pos from 1 to 4 it's very fast to copy and paste.

I'm searching a similar solution to update {{!COLX}} values

Thanks

Yep, exactly...!, and you'll be using your 'Pos' on the Index for the 'split()[n]' + "ADD 1", only initializing your 'Pos' at "-1" for the 'ADD 1' to start at "0"... 8)
- (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...
provoquestosito
Posts: 78
Joined: Sat Jan 30, 2010 12:43 am

Re: Easy and Fast way to update {{!COLX}} values in macro

Post by provoquestosito » Sat Jul 20, 2019 3:41 pm

Hi @chivracq

Thanks for suggestion.

Can you provide me an example in pure iim (I prefer iim).

I do not know this command '!DATASOURCE_DELIMITER' .

If you can provide me an example i can know how create this feature in my macro.

This part i do not know well how i can i create
I would think, in pure '.iim' by simply "misusing" the '!DATASOURCE_DELIMITER' Command, and changing it temporarily to some "fake" Separator to extract a complete Row with just one single '{{!COL1}}' and using 'EVAL()' + 'split()', you re-split that whole Row into all Cols... 8)
(Index starts at "0" for 'split()'...)

I never tested though about "Speed" as you are talking about 1000 Cols. It's "instant" for about 20 Cols, I don't know for 1000 Cols...
Thanks
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Easy and Fast way to update {{!COLX}} values in macro

Post by chivracq » Sat Jul 20, 2019 5:28 pm

provoquestosito wrote:
Sat Jul 20, 2019 3:41 pm
Hi @chivracq

Thanks for suggestion.

Can you provide me an example in pure iim (I prefer iim).

I do not know this command '!DATASOURCE_DELIMITER' .

If you can provide me an example i can know how create this feature in my macro.

This part i do not know well how i can i create
I would think, in pure '.iim' by simply "misusing" the '!DATASOURCE_DELIMITER' Command, and changing it temporarily to some "fake" Separator to extract a complete Row with just one single '{{!COL1}}' and using 'EVAL()' + 'split()', you re-split that whole Row into all Cols... 8)
(Index starts at "0" for 'split()'...)

I never tested though about "Speed" as you are talking about 1000 Cols. It's "instant" for about 20 Cols, I don't know for 1000 Cols...
Thanks

Ah...!?, OK... Well, it's not very complicated, and especially for you I would think, if you've been using iMacros for nearly 10 years... :o
But OK, here we go, and I even include some "Mechanism" to avoid the Index=0 and to sync the '!COLn' and the 'split()[n]'... 8)
And as I'm not sure about Speed for 1000 Cols, I retrieve one full Row only once and store it in a Var...

Code: Select all

SET Separator ##
SET !DATASOURCE_DELIMITER {{Separator}}
SET Full_Row {{Separator}}{{!COL1}}
SET Col_Index 0

ADD Col_Index 1
SET Col_n EVAL("var fr='{{Full_Row}}', n='{{Col_Index}}', s='{{Separator}}'; var z; z=fr.split(s); z[n];")
TAG POS={{Col_Index}} TYPE=LABEL FORM=ID:post ATTR=TXT:{{Col_n}}

ADD Col_Index 1
SET Col_n EVAL("var fr='{{Full_Row}}', n='{{Col_Index}}', s='{{Separator}}'; var z; z=fr.split(s); z[n];")
TAG POS={{Col_Index}} TYPE=LABEL FORM=ID:post ATTR=TXT:{{Col_n}}

'Etc...
... And you repeat the 3 Line Block as often as you want...

(Not tested of course...)
- (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...
provoquestosito
Posts: 78
Joined: Sat Jan 30, 2010 12:43 am

Re: Easy and Fast way to update {{!COLX}} values in macro

Post by provoquestosito » Fri Sep 13, 2019 3:04 pm

Thanks @chivracq for your solution
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Easy and Fast way to update {{!COLX}} values in macro

Post by chivracq » Sat Sep 14, 2019 12:04 am

provoquestosito wrote:
Fri Sep 13, 2019 3:04 pm
Thanks @chivracq for your solution

Rhooo...!, good to see that you are still alive, 2 months later...!! :wink:

Well, Thanks for your "Thanks", but..., pfff..., did you try my Script/Solution...?, or are you just kind of "fake-thanking" me because you just opened a new Thread...? :roll:

Sorry, but when I help you (or any User on the Forum) and do some "Thinking" for a Thread and especially if I write a Script for the User, I expect a mini-bit of Follow-up..., and not 2 months later because you/they need some Help again... :cry:
- (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...
provoquestosito
Posts: 78
Joined: Sat Jan 30, 2010 12:43 am

Re: Easy and Fast way to update {{!COLX}} values in macro

Post by provoquestosito » Sat Sep 14, 2019 2:22 pm

Hi

I realized that the code is too complex and it doesn't even work for me so I abandoned this idea as it loses too much time and also causes errors and problems.

I tryed it but do not work but I recognize that the code is too complex and therefore I expected errors, usually I make macros in a very simple way to avoid possible errors.

I hoped you could accomplish a similar function in a simple way and with a few lines of code.

Thanks
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Easy and Fast way to update {{!COLX}} values in macro

Post by chivracq » Sun Sep 15, 2019 8:27 pm

provoquestosito wrote:
Sat Sep 14, 2019 2:22 pm
Hi

I realized that the code is too complex and it doesn't even work for me so I abandoned this idea as it loses too much time and also causes errors and problems.

I tryed it but do not work but I recognize that the code is too complex and therefore I expected errors, usually I make macros in a very simple way to avoid possible errors.

I hoped you could accomplish a similar function in a simple way and with a few lines of code.

Thanks

Ah..., OK... Well..., Thanks for the "Feedback"/Follow-up..., but without digging into it, I'm pretty sure the Script I had posted should work, or at least the Principle if you understand it, I had not tested it, so it could be that it contains a few stupid Typos that should be easy to spot and clean, but pfff..., 2 months later, I'm not digging into it again..., you should have reacted a bit quicker... :cry:

Maybe one day some other User will "surf" on this Thread, and if they post "properly", then OK, maybe I will dig into it again... :|
- (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