Writing a fileparser

From: Date: Thu, 13 Mar 2003 12:24:53 +0000
Subject: Writing a fileparser
Groups: php.general 
Request: Send a blank email to php-general+get-139486@lists.php.net to get a copy of this message
Hi together, i´m currently working on a php script to read a txt file into a mysql database. but i have several problems i don´t know how to fix. the file looks like the following example: category 1 Data1 ::#:: 27 Data2 ::#:: 0 Data3 ::#:: (152) category 2 Data1 ::#:: 2b3 Data2 ::#:: 234 Data3 ::#:: (1) the qeuestion i have is how can i parse each line and use the "category" fields as identifier for the tables, the left side of ::#:: as identifier for the row´s and the right side as the data. the problem is collecting the several pieces of data in different variables. perhaps someone can give me some help or a url where i can find some documentation. many thanks! alex

« previous php.general (#139486) next »