Date: 06/15/02
- Next message: Lance: "Re: [PHP] Regular expression newbie question, convert this: [::word1 \" word2 \" word3::] to : ".word1 " word2 " word3.""
- Previous message: Lazor, Ed: "RE: [PHP] Search - 'AND' ... 'OR'"
- Next in thread: Nathan Taylor: "Re: [PHP] Parsing Text File"
- Maybe reply: Nathan Taylor: "Re: [PHP] Parsing Text File"
- Reply: Analysis & Solutions: "Re: [PHP] Parsing Text File"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I am trying to input data from a text file into a MySQL database and would
like to be able to input the data using a single script. What's the easiest
way to parse a line, such as below, and turn it into variables to be placed
in the database. While I can simply place the data in by importing from a
file, it's not quite so easy. I only need to place some of the data in,
plus I would like to split one of the fields. Below is an example of a line
from the file, and then the variables that I need to enter.
Here is an example of a line from the file:
Number,City,State,Country,Provider,Isdn,56K,CreateDate,Active,Timezone,ModDa
te,ModNote
403 -770 -4904 ,CALGARY,AB,CAN,T2,Y,Y,Apr 29 2002
12:00:00:000AM,I,GMT-0700,,
As for variables, I need the following:
Split Number into $AreaCode & $Number > 403 & 770-4904
$City
$State
$Country
Thanks for any help.
Jason D. Williard
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: Lance: "Re: [PHP] Regular expression newbie question, convert this: [::word1 \" word2 \" word3::] to : ".word1 " word2 " word3.""
- Previous message: Lazor, Ed: "RE: [PHP] Search - 'AND' ... 'OR'"
- Next in thread: Nathan Taylor: "Re: [PHP] Parsing Text File"
- Maybe reply: Nathan Taylor: "Re: [PHP] Parsing Text File"
- Reply: Analysis & Solutions: "Re: [PHP] Parsing Text File"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

