Re: How to read a text file with variable line length?

From: Date: Mon, 08 Oct 2001 04:35:15 +0000
Subject: Re: How to read a text file with variable line length?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-70318@lists.php.net to get a copy of this message
Or possibly even just file() - in many situations this is easier than having to use fopen, then read the file in, then close it. jason > Use fgets() > http://www.php.net/manual/en/function.fgets.php > > -Jason Garber > www.IonZoft.com > > At 08:19 PM 10/7/2001 -0600, Carlos Fernando Scheidecker Antunes wrote: > >Hello all, > > > >I would like to ask the following help concerning text files. > > > >I've got column delimited text files and I need to read each line/record to > >populate a MySQL table. > > > >I understand that when you use fread($file, $length) you must specify the > >length of each line. The problem is that the last column is a description > >column and it can be from zero chars to 50 chars long. Because of that the > >length of each line is not a fixed number. > > > >What to do in a situation like this? > > > >Thanks in advance, > > > >Carlos Fernando Scheidecker Antunes.

« previous php.general (#70318) next »