Re: How to read a text file with variable line length?
| From: | Richard Lynch | Date: | Sun, 07 Oct 2001 03:24:04 +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-70274@lists.php.net to get a copy of this message | ||
http://php.net/fgets
--
WARNING richard@zend.com address is an endangered species -- Use
ceo@l-i-e.com
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Carlos Fernando Scheidecker Antunes <nando@antunes.eti.br>
Newsgroups: php.general
To: <php-general@lists.php.net>
Sent: Sunday, October 07, 2001 9:19 PM
Subject: How to read a text file with variable line length?
> 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.