I have a very big .txt file with our clients order and I need to move it in a mysql database . However I don't know what kind of regex to use as the information is not very different .
----------------------- 4046904 KKKKKKKKKKK Laura Meyer MassMutual Life Insurance 153 Vadnais Street Chicopee, MA 01020 US 413-744-5452 [email protected]... KKKKKKKKKKK 373074210772222 02/12 6213 NA ----------------------- 4046907 KKKKKKKKKKK Venkat Talladivedula 6105 West 68th Street Tulsa, OK 74131 US 9184472611 venkat.talladivedula... KKKKKKKKKKK 373022121440000 06/11 9344 NA -----------------------
I tried something but I couldn't even extract the name ... here is a sample of my effort with no success
$htmlContent = file_get_contents("orders.txt"); //print_r($htmlContent); $pattern = "/KKKKKKKKKKK(.*)\n/s"; preg_match_all($pattern, $htmlContent, $matches); print_r($matches); $name = $matches[1][0]; echo $name;