Re: Reading from various .txt files in directory

From: Date: Tue, 27 May 2003 11:57:58 +0000
Subject: Re: Reading from various .txt files in directory
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-149089@lists.php.net to get a copy of this message
First you need to find the file: open the directory, read each entry from it and see if it is *.txt (Directory functions in the manual). Then you need to get the line, look at Filesystem functions. Then you need to get the elements separated by %, see explode(). TWSC HQ wrote:
Hi guys, Is the following possible and how do you do it? I have various .txt files in a single directory - all in the same format: Content of abc.txt file: 1%23%5%2003%0.00%0.00%7.78 Content of def.txt file: 9%20%5%2003%0.00%0.00%100.00 Data is seperated by a % sign - Now, how do I display the 2nd, 3rd, 4th and last entry (for each file in the directory) in table format in a browser? In other words I need the output to be in browser : 23 5 2003 7.78 20 5 2003 100.00 Trick is that the .txt file names are randomly generated - they can be abc.txt, gyu.txt, iyu.txt etc. Any help or ideas would be appreciated! thanx! August


« previous php.general (#149089) next »