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

[PHP] fscanf syntax

2001-03-30 Thread Patrick Brown
I want to parse a file with the following syntax. 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 reporting. Some of you