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
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
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
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
- 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
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
"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
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
8 matches
Mail list logo