Forum Moderators: coopster

Message Too Old, No Replies

help with displaying text file data

         

ahmed24

7:29 am on Sep 5, 2006 (gmt 0)

10+ Year Member



hi, i have a script that stores data in a text file. the data is a list of events formatted in the following way

10-09-06, Description of Event 1~
11-09-06, Description of Event 2~
12-09-06, Description of Event 3~

the data is stored in a file called data.txt, i would like to know how i can call this file and display the events dynamically. i would only like to display the event that is upcoming next and once the date of the event comes, then the i'd like to display the next available event (by date, not by line numbers) and so forth.

can anyone please tell me how i can achieve this.

thank you

ahmed24

2:03 pm on Sep 5, 2006 (gmt 0)

10+ Year Member



anyone?

coopster

2:10 pm on Sep 5, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You'll have to read the entire text file in, that's the way it works. Load the data into an array and sort it, do your lookup and retrieve the corresponding index values from the array.