RE: [PHP] Help with Flat text file.
| From: | Jason Stechschulte | Date: | Thu, 02 Nov 2000 13:40:16 +0000 |
| Subject: | RE: [PHP] Help with Flat text file. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-23389@lists.php.net to get a copy of this message | ||
You have 2 options:
1. Use a different delimiter that won't show up in the file.
2. Check all variables before writing them to the file, if they
contain ':' then either substitute it for a different character
or mark it in some way. Then when you display the file, you will
have to change it back.
Jason Stechschulte
jpstech@nc.edu
-----Original Message-----
From: Lawrence Ng [mailto:lawrence@imigis.com]
Sent: Wednesday, November 01, 2000 12:57 PM
To: php-general@lists.php.net
Subject: [PHP] Help with Flat text file.
Hello everyone. (I am not sure if this post is appropriate.)
I was wondering if anyone can help me.
I have the following flat text file and need to parse out the
results.
Keyword:1:3:mp3:Owner:1:9:anewshopp:Title:1:40:anewShop.com's MP3
Player
Shopping Guide:
Keyword:2:3:mp3:Owner:2:7:readyja:Title:2:54:Faster MP3 Downloads
Now!
Go!Zilla - a free download.:
Keyword:3:3:MP3:Owner:3:6:seline:Title:3:72:Pianists Raul Di
Blasio,
Giovanni Marradi, Yanni, more. New Age, Latin.:
Keyword:4:3:mp3:Owner:4:10:rockenroll:Title:4:14:RockenRoll.com:
The first field is the field value,
second field is the row number, third field is the number of
characters in
the fourth field, and the fourth field is an actual value.
The next four repeat the same pattern.
I currently have a parser that separates each row into an array
using the
colon and I run into problems when there is a colon in the
fields. Is there
a php function to read this type of text file?
I was told that this is a common format.
Any help would be appreciated.
Please contact lawrence@imigis.com with any information.
Thanks!!
Lawrence Ng
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail:
php-list-admin@lists.php.net