Morning,
I'm sure there is an easy explanation. I have this code to clean up a text file so it can be uploaded to a database.
$data = file_get_contents("../PHP/Yardcheck.txt");
$data = str_replace("|", ",", $data);
$data = str_replace(" ", "", $data);
$fp = fopen("../PHP/Yardcheck.txt", "r+");
fwrite($fp, $data);
fclose($fp);
It works perfectly....then the last three records are left alone.
Yard,568932,C,MT,,,05/20/20,01:31,Woodbridge
Yard,25693,C,MT,,,05/20/20,01:31,Dayton
Yard,55566,C,MT,,,05/20/20,02:15,Woodbridge
Yard,56986,C,MT,,,05/20/20,02:15,Woodbridge
Yard,5555,C,MT,,,05/20/20,02:23,Woodbridgeton
Yard |55566 |C|MT|? |? |05/20/20|02:15 |Woodbridge
Yard |56986 |C|MT|? |? |05/20/20|02:15 |Woodbridge
Yard |5555 |C|MT|? |? |05/20/20|02:23 |Woodbridge
Any thoughts would be appreciated.
Thanks
Laura