[PHP] What's the problem with this PHP code?

2011-11-04 Thread Sophia

Here is the PHP code:


?php


$panka =c:can-it-rock-
:the-boat-of-
:love-  ;

$pankb = preg_split(':',$panka);
$pankc = $pankb{1};

echo ( . $panka . )\n( . $pankc . )\n;


?






I keep getting the following error:

Sophia-Shapiras-MacBook-Pro:tmp red_angel$
Sophia-Shapiras-MacBook-Pro:tmp red_angel$ php testo.php

Warning: preg_split(): No ending delimiter ':' found in 
/Users/red_angel/tmp/testo.php on line 8

(   c:can-it-rock-
:the-boat-of-
:love-  )
()
Sophia-Shapiras-MacBook-Pro:tmp red_angel$
Sophia-Shapiras-MacBook-Pro:tmp red_angel$




So --- what am I missing? What am I doing wrong? I'm pulling my hair out 
over this one! Anyone have a clue what's up? I can see that the colon is 
present *multiple* times in the string that is meant to be split! How 
come PHP's preg_split() function can't see it?


Thanks,
Sophia

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Need Help - extract unstructured data for parse reformat and import into DB

2004-02-02 Thread Sophia Morgan
I need to get some guidance on a project. I have to extract unstructured data from a 
.CSV file and reformat the data to import into MSSQL.

The unstructured data is basically in some kind of sub summary report. Note: the files 
will include a range from 1 to 12 months of information (month to date). Four 
different .CSV files would need to be reformatted at the same time. The file size for 
one is about 1.7 MB and containing roughly around 21,115 rows of data in each.

Would PHP be a good program to use for this project? Has anyone had to reformat 
unstructured data to insert into a database?  If anyone has any suggestions or 
examples please let me know. J

I was thinking about importing the data into an array then parsing through the 
information with multiple if statements then using SQL to insert the data into a 
database. This will be my first PHP parse project so any examples and suggestions to 
get me started would be greatly appreciated. A small sample of the data structure is 
below:

Thank You,
Sophia
[EMAIL PROTECTED]

/WCS37  /WCS9   /WCS9   WCS9

RETAIL  REGIS   PAG E1
VEHIC   LE TYPE CAR T
AREA:   PLACE
MONTH   MONTH   MONTH
OCT.SEP.AUG
200320032003
GROUP MAK MDL
- ---  ---  -   -   -
SPTY COUP AU RSX3   4   8
CCT CAR FORD FC 4   1   7


REPORT DATE: 1/12/01

RETAIL  REGIS   PAG E1
VEHIC   LE TYPE CAR T
AREA:   PLACE2
MONTH   MONTH   MONTH
OCT.SEP.AUG
200320032003
GROUP MAK MDL
- ---  ---  -   -   -
SPTY COUP AU RSX1   7   3
CCT CAR FORD FC 2   2   5


REPORT DATE: 1/12/01

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php