Re: [PHP] fscanf and memory

2004-02-26 Thread Tom Rogers
Hi, Friday, February 27, 2004, 4:48:20 AM, you wrote: SG> Hi, SG> I don't know if it's a bug in php but if I do SG> $fp=fopen("some_file","r"); SG> while (!feof($fp)) SG> { SG> fscanf($fp, "%d %d",&$var1,&$var2); SG> // some treatment SG> } SG> fclose($fp); SG> and the file is big enoug

Re: [PHP] fscanf syntax

2001-03-30 Thread Patrick Brown
Thanks Chris, That worked great. I didn't know that a file could be read directly into an array. --Pat "Chris Fry" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Pat, > > You could read the file into an array; > > $aryNessus = file("/pathtofile/filename", "r

Re: [PHP] fscanf syntax

2001-03-30 Thread Chris Fry
Pat, You could read the file into an array; $aryNessus = file("/pathtofile/filename", "r"); Each row of the array then has one line from the file; Get the record count; $intNumRecs = count($aryNessus); Now read through the array and extract the values; for($i=0;$i<=$intNumRecs;$i++) { $ar

Re: [PHP] fscanf syntax

2001-03-30 Thread Brian Clark
Hi Patrick, @ 9:04:59 PM on 3/30/2001, Patrick Brown wrote: ... > hostname|protocol|number|severity|description > Each record is on it's own line and have the fields delimited by the pipe > character |. The file may have thousands of records and I would like to > bring them into a database for

Re: [PHP] fscanf

2001-03-12 Thread Yasuo Ohgaki
- Original Message - From: "Kubol" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, March 13, 2001 12:48 AM Subject: Re: [PHP] fscanf > 01-03-13 05:00:01, "Yasuo Ohgaki" <[EMAIL PROTECTED]> wrote: > > >I think fscanf() is li

Re: [PHP] fscanf

2001-03-12 Thread Kubol
01-03-13 05:00:01, "Yasuo Ohgaki" <[EMAIL PROTECTED]> wrote: >I think fscanf() is line oriented in C, isn't it? (I haven't used fscanf() for a >long time, I'm not 100% sure w/o reference.) no, i'm sure in c fscanf reads the next string available, not first string in next line >Your $buffer should

Re: [PHP] fscanf

2001-03-12 Thread Yasuo Ohgaki
"Kubol" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > hello > > if this is really a silly problem dont blame me, i'm a newbie in php (but i'm experienced in c++ a bit :-) > well, imagine i want to write a content of some text file word by word. example will be

Re: [PHP] fscanf problem

2001-02-12 Thread John Vanderbeck
Hmm..noone has any ideas on this one? Its really driving me crazy - John Vanderbeck - Admin, GameDesign - Original Message - From: "John Vanderbeck" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, February 11, 2001 10:01 PM Subject: [PHP] fscanf problem > my code... > > WR