|
Post by sharecow on Apr 4, 2019 15:08:21 GMT
Hi everybody, I'm thankfully using this brilliant "little" tool for a while now. Thanks, Steve for your work so far! I have a csv file with 2 columns. Col 1 contains urls and col 2 names accordingly. Since mmm does not parse csv I exported the csv content into 2 separate files: url.txt and name.txt. I need a loop that does cycle through the url.txt firstly and secondly name.txt. Both values are needed in the same cycle. 1 | FOR | EACH | LINE IN | url.txt | DO ... %LINE% <-- 1st line of urls.txt ... <-- 1st line of name.txt 1 | FOR | NEXT I have written quite complex stuff in mmm already, but I cannot figure out how to get this done. Thanks for your help.
|
|
|
Post by sharecow on Apr 9, 2019 9:57:49 GMT
This still gives me headaches ... no one an idea?
|
|
|
Post by Steve on Apr 13, 2019 7:18:51 GMT
I spent a bit of time on this and initially I was thinking of nesting two FOR EACH LINE IN loops but it's not working as expected. The %LINE% variable I was using to catch the input from each file to store into variables wasn't changing after breaking each for loop. I'm going down the path of OUTPUT TO FILE for each variable.
I'll have another look into this and let you know.
|
|
|
Post by Steve on Apr 25, 2019 6:37:29 GMT
Hi are you still stuck on this? Check out this post were we use CLIPBOARD to pass variables between MMM instances ( minimousemacro.proboards.com/thread/152/input-box-focus-when-pops). Maybe we can use clipboard to carry out %LINE% value to the new loop. Something like this: 3 | RUN ACTION | COPY TO CLIPBOARD | %LINE% 60 | RUN ACTION | DEFINE STRING VARIABLE | %STRING%::%CLIPBOARD%
|
|
|
Post by aeronnaex on Nov 22, 2022 21:16:10 GMT
I know this is an old thread, but I'm trying to do something similar - pull line values from two files at the same step in the loop. To explain:
1 | FOR | EACH | LINE IN | D:\SourceTEST.txt | DO
2 | RUN ACTION | DEFINE STRING VARIABLE | %SOURCE%::%LINE%
3 | FOR | EACH | LINE IN | D:\TargetTEST.txt | DO
4 | RUN ACTION | DEFINE STRING VARIABLE | %TARGET%::%LINE% <STUFF HAPPENS.....SUCCESSFULLY> 75 | FOR | NEXT
For the first time the loop is read - it's all good. %SOURCE% and %TARGET% have their proper values from the correct files.
When the loop starts again however, they have the same values they had before. They've not moved down to the second line in their respective files.
I wondered if I could have one FOR loop, and have both variables set from different files using the same %LINE% value, but I don't know what the context of that would be. I'm also not sure how to use the %CLIPBOARD% solution for two source files.
Alternately, I thought about somehow putting both values into a single file, but after looking on the board saw this would not work.
|
|
|
Post by aeronnaex on Nov 22, 2022 21:38:44 GMT
I've got the context for loading from two files, but the variables %SOURCE% and %TARGET% never move down the list, even after a FOR|NEXT. 1 | FOR | EACH | LINE IN | D:\SourceTEST.txt | DO 6 | RUN ACTION | INPUT FROM FILE | SOURCE::NO_REFRESH: :\SourceTEST.txt 5 | RUN ACTION | INPUT FROM FILE | TARGET::NO_REFRESH: :\TargetTEST.txt The variables through the first two loops look like this - they don't change, although clearly MMM has some knowledge of the other values for each: %SOURCE%=source1 source2 source3 source4 source5 %TARGET%=target1 target2 target3 target4 target5
|
|