how to get a random line from a random file

Lannister

Client
Регистрация
28.08.2011
Сообщения
19
Благодарностей
2
Баллы
0
hi,

how to do that in ZP4 : {-File.GetString-|-{-Directory.RandomFile-|-\Resources\-}-|-random-|-true-}

ZP4 is become so complicated :/

thanks !
 

lupo

Client
Регистрация
28.05.2012
Сообщения
72
Благодарностей
32
Баллы
18
Here it is :-)

P.S. I'm sure that there is much better way to do it, but this works also :-)
 

Вложения

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

Lannister

Client
Регистрация
28.08.2011
Сообщения
19
Благодарностей
2
Баллы
0
Thank you for your help :-)

but it does not delete the line in the file.
If i want to do that i need to take the content of the file & delete it, get a random line, and write a new file with the new content.

that's a lot of blocks :/
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 707
Баллы
113
You create a list
In list properties set the text file to sync with.
Then use action Operations with lists - Get line
 
  • Спасибо
Реакции: Lannister

Lannister

Client
Регистрация
28.08.2011
Сообщения
19
Благодарностей
2
Баллы
0
Thanks it works, in the file path of the list i set : {-Directory.RandomFile-|-{-Project.Directory-}\files-} ,(I did not think it would work -_-)
 

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