Picking a random line from a text file to clipboard

Post here if you need help using Actiona
Post Reply
6badboy9
Posts: 3
Joined: 04 Jun 2021, 22:34

Picking a random line from a text file to clipboard

Post by 6badboy9 »

Hi, I was wondering if it is possible to add a line that picks a random line from a list or text file and copy it to clipboard? I am really noobie to coding, I would appreciate if someone could help me with this if its even possible, Thanks.
francois
Posts: 379
Joined: 18 Oct 2010, 10:33
Location: France

Re: Picking a random line from a text file to clipboard

Post by francois »

An example attached .

Choose the file in the first action :

Code: Select all

file_= "C:/temp/rnd/fichier.txt"
rnd.zip
(1.57 KiB) Downloaded 31 times
6badboy9
Posts: 3
Joined: 04 Jun 2021, 22:34

Re: Picking a random line from a text file to clipboard

Post by 6badboy9 »

ty so much man, I really appreciate it
6badboy9
Posts: 3
Joined: 04 Jun 2021, 22:34

Re: Picking a random line from a text file to clipboard

Post by 6badboy9 »

Hello again, i have found a lil issue when running in ubuntu, doesnt occur on windows, it copies nothing on last line even tho there is a text on that line, for example on this screenshot I have added shows that line 5 comes empty, would appreciate if you can find any workaround for this, Thanks alot already for the code.
Attachments
06ad2f8bab948155464795ad18df520d.png
06ad2f8bab948155464795ad18df520d.png (9.26 KiB) Viewed 419 times
Post Reply