several lists next to eachother

archel

Client
Регистрация
02.05.2011
Сообщения
175
Благодарностей
22
Баллы
18
Hello

This is probably easy to do but I can't find out how to do it.

Let's say you have 3 lists/variables:
a1
a2
a3
a4

b1
b2
b3
b4

c1
c2
c3
c4

Now, how could I get those variables easily next to eachother, seperated by eg |?
So that I would get
a1|b1|c1
a2|b2|c2
a3|b3|c3
a4|b4|c4

Thanks in advance.
archel
 

drvosjeca

Client
Регистрация
26.10.2011
Сообщения
512
Благодарностей
455
Баллы
63
just pull the line from each of the lists, put it to variable and your job is done... if you want to save them to that form, you just put them like:

{-variblefromlist1-}|{variblefromlist2}|{variblefromlist3} into table or files action block, where you use save text
 

archel

Client
Регистрация
02.05.2011
Сообщения
175
Благодарностей
22
Баллы
18
Don't really know what you mean. Do you mean one line per line? eg take variables a1, b1 and c1 and convert into a1|b1|c1, then same for a2|b2|c2,...? If so, I of course know you can do that.

What I would like to do is have all lines at once. So eg 3 lists converted into 3 columns, seperated by a |.
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
Just take 1st line from each list, delete them and write to 4th list in format {-Variable.var1-}|{-Variable.var2-}|{-Variable.var3-}, create a loop and to this again as many times as you need
 

archel

Client
Регистрация
02.05.2011
Сообщения
175
Благодарностей
22
Баллы
18
So we can conclude that here is no easy/fast way to do it with zenno.
I know how to loop but if you have to loop it 10.000 times, it's not quite handy.

Would have been great if you could eg write the first list to column A of a table, second list to column B, third list to column C ... and then write to file while converting column seperation to |. If the lists would be 10.000 lines big, then this second method would be a lot faster.
 

sMax

Client
Регистрация
04.05.2011
Сообщения
132
Благодарностей
49
Баллы
28
What you suggest would gobble up a LOT of memory,
drvosjeca and Rostonix gave you the simple (simple is best) way to do it.
I don't know why you are reordering the data(or if you really need to reorder it), but maybe you can write the output to a file and then use them from the file.

The only thing you could improve/change is to make the template assemble only one line and then run it in zennoposter 10,000 times, that will keep your template light and using less memory, so it should be fast and you'll have much more control.


Otherwise just make an notepad++/excel macro/script to do that. which you could also run, call from zennoposter or schedule in windows scheduler.
 

archel

Client
Регистрация
02.05.2011
Сообщения
175
Благодарностей
22
Баллы
18
I'm not reassembling data.
I'm just pulling data from a table on a webpage and I want to put the table in a file.
Columns of a table have to be seperated by a delimiter if you want to put it in a file.

eg
Name 1|Age 1|Mail 1
Name 2|Age 2|Mail 2

But it's ok, I've found a solution. It's not simple, but it's certainly better. ;-)
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
It's always a good idea to share better solution with other clients who tried to help you :-)
 

thelastog

Client
Регистрация
06.10.2012
Сообщения
79
Благодарностей
8
Баллы
8
i 2nd that.
 

archel

Client
Регистрация
02.05.2011
Сообщения
175
Благодарностей
22
Баллы
18
Well, you regexp all the rows (eg stuff between <tr></tr>)...and these consist out the columns data for that line, which you need, and the html code between it, which you don't need. You then regexp replace the stuff you don't need with your delimiter (if between column data) or with nothing.

Can be a pain in the ass to find the good regexp, but once you have it, it's nice.

Didn't share it in my previous post because I think you will say it's too memory extensive.
 

drvosjeca

Client
Регистрация
26.10.2011
Сообщения
512
Благодарностей
455
Баллы
63
i would never say that is better solution because you dont realize what are you doing there, and how many things can go wrong that way... :P
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
I actually use both solutions ) For some tasks)
Everyone is different and what's easier for one can be harder for other :-)
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)