|
Posted by vito on 05/05/06 12:03
I have a text file (see below please) to parse with the following code. i
don't know why it cannot match anything. thanks.
$data=fread(fopen("$dir/$file","r"),filesize("$dir/file"));
$matchno = preg_match_all("|.*:(.+)\n$|U", $data, $reg);
for ($i=1; $i<$matchno; $i++) {
$line = ",'".trim($regs[1][$i]."'");
fwrite($fp, $line);
}
GROUP: CARS R/C SERIES
PRODUCT
NAME: R/C CAR
PACKAGE: WINDOW BOX
SIZE:30.5‘Α12‘Α10.6 cm
MEAS:84* 34*93 cm
PCS/CTN: 48 pcs
GROSS
WEIGHT: NIL
NET
WEIGHT: NIL
INNER
BOX QTY: NIL
[Back to original message]
|