get random line from .txt file
Hello everyone...
I have a .txt file, with around 754 lines. Each line has a pattern like this:
1st part#2nd part#3rd part.
The hashtag is the delimiter!
What I'm trying to do is to get() or read() this text file, and pick a random line from it, with all the pattern.
But it has to be a random line.
So I can print it or append html to a div. It should look something like this:
1st part from a line
2nd part from the same line
3rd part from the same line
It has this pattern, cuz maybe I'll have to print only one part of the pattern.
I don't know if a text file is the right type of file to pull data from.... Its only 80kb.
There is any way to do this? Could someone give me a hand? I'm actually a designer, this thing is driving me crazy.
Thank you guys!
I appreciate any help.