Re: [tf-dis] randline function in textutil.tf
Brought to you by:
kenkeys
|
From: Ron <rph...@ho...> - 2016-06-12 22:51:25
|
Edit testutil.tf and change the line in this method from:
/test rand(++_lines) | (_selection := {*})%; \
.. to..
/test rand(++_lines) | (_selection := {_line})%; \
That should do it.
________________________________
From: ha...@vn... <ha...@vn...>
Sent: Sunday, June 12, 2016 8:33 AM
To: TinyFugue Discussions
Subject: [tf-dis] randline function in textutil.tf
Hello all. I've used other functions from the textutil.tf file with no problems, but when attempting to use the randline function, things aren't working as I expected them to. The description in the helpfiles says that it should return a random line from the handle or from tfin. All I can get it to do for me is to return the actual handle (the stream ID from when the file I want searched is open). So here is the code I have.
First, the data file. Its just a text file with different text on separate lines, that will eventually be random party names, but just this boring stuff for now.
party_db.txt:
line 1
line 2
line 3
line 4
Here is the test script I wrote:
/require textutil.tf
/def temp = \
/let temp=$[tfopen("party_db.txt", "r")] %; \
/randline %{temp} %; \
/test tfclose(%{temp})
So this _should_ return a random line from the data file, but just gives me the number of the tfio stream it is supposed to be searching. If anybody has gotten this to work, please let me know what you did!
Thanks
--Tommy
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
TinyFugue-discuss mailing list
Tin...@li...
https://lists.sourceforge.net/lists/listinfo/tinyfugue-discuss
|