RE: [PHP] Processing file...
| From: | Jeff Lewis | Date: | Fri, 27 Jul 2001 01:30:10 +0000 |
| Subject: | RE: [PHP] Processing file... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-59853@lists.php.net to get a copy of this message | ||
Yes actually, I figured it out. I was trying to parse the buffer as well
but managed to figure it out tonight :) Just took a lot of debugging ;)
Jeff
> -----Original Message-----
> From: David Robley [mailto:huntsman@www.nisu.flinders.edu.au]
> Sent: Thursday, July 26, 2001 9:31 PM
> To: Jeff Lewis; php-general@lists.php.net
> Subject: Re: [PHP] Processing file...
>
>
> On Fri, 27 Jul 2001 06:25, Jeff Lewis wrote:
> > I managed to process a directory of files but for some reason I am
> > having trouble figuring out this :/
> >
> > I am going through a directory opening all dat files. Now it is
> > working properly but I need to grab the data from it. I need to grab
> > each line as indicated below.
> >
> > Here is the code I was using to open the file....
> >
> > $file="/home/saveraps/public_html/cgi-bin/Members/".$entry;
> >
> > //Open current roster file
> > $fd = fopen ($file,'r');
> >
> > while (!feof ($fd)) {
> > $buffer = fgets($fd, 4096);
> > $member = trim(substr($buffer,0,50));
> > echo "File: ".$entry."<BR>";
> > } //end file open - !eof
> >
> > fclose ($fd);
> >
> > And here is the structure of these files. For each line I need to grab
> > it and keep it associated with the members dat file. Each dat file
> > contains this info (hyrum.dat)
> >
> > admin
> > admin
> > me@mysite.com
> > Homepage Title
> > http://yabb.xnull.com
> > Signature
> > 3
> > Administrator
> > 571803
> > HyrumAIM
> > HyrumYIM
> > Male
> > I Love YaBB 1 Gold!!!
> > bobafett.gif
> > 01/01/01 at 01:01:01
> > Kitchener
> > 07/14/1975
> > 4
> > 2
> >
> > How can I grab all of these for each dat file I open up?
> >
> > Jeff
>
> Use file to pass the lines of the file into an array?
>
> --
> David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
> CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
>
> Daddy, what does FORMATTING DRIVE C: mean?
>
>