How to read a text file with variable line length?

From: Date: Mon, 08 Oct 2001 02:19:49 +0000
Subject: How to read a text file with variable line length?
Groups: php.general 
Request: Send a blank email to php-general+get-70262@lists.php.net to get a copy of this message
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 (#70262) next »