automated xlsx files naming/creation

jcknick

Client
Регистрация
10.05.2013
Сообщения
154
Благодарностей
9
Баллы
18
Hi guys,

I've stumbled into an issue that when I scrape with more than 10 threads in ZP, the xlsx file that the data is written to sometimes switches file size to 0 (like it's busy), then the other treads can't write anything to it and treat it as error or something.

As a bypass for it, I wanted to generate the unique xls file names for each thread, so that each tread is working with it's own file.

Here's how I decided to do it.

1. generate a random number
2. append file name to that number - RESULT_{-Variable.RAND-}
3. specify the table file location with the resulting file_name_rand.xlsx (
{-Project.Directory-}\{-Variable.FILENAME-}.xlsx)

It worked ONCE :-) But then the result file the threads were generating or writing to was .xlsx

What am I doing wrong or how can this be done properly?
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 707
Баллы
113
Do not set path with variable in table settings. Leave it empty.
And use Table processing - Bind to file action.
 
  • Спасибо
Реакции: jcknick

jcknick

Client
Регистрация
10.05.2013
Сообщения
154
Благодарностей
9
Баллы
18

jcknick

Client
Регистрация
10.05.2013
Сообщения
154
Благодарностей
9
Баллы
18
Just tried, bind to file (create of non existent) - tried both

{-Project.Directory-}\{-Variable.FILENAME-}.xlsx and {-Project.Directory-}\{-Variable.FILENAME-}

Got two 0kb files which give me an error on open

Screen Shot 2015-12-04 at 12.38.57 PM.png
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 707
Баллы
113
How do you add data there after you bind table to file? wiith File or Table action?
 

jcknick

Client
Регистрация
10.05.2013
Сообщения
154
Благодарностей
9
Баллы
18
Table action
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 707
Баллы
113
Cannot reproduce.
please check
 

Вложения

  • Спасибо
Реакции: jcknick

jcknick

Client
Регистрация
10.05.2013
Сообщения
154
Благодарностей
9
Баллы
18
Yeah, now i know how this should work. Bind first, write second... Thank you very much as usual!
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 707
Баллы
113
:az:
 

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