In order to get rid of some \ characters that appeared within the form results. I also figured out that the reason the tab characters were not showing up was because tabs are not shown in HTML and the echo command feeds back the results of the PHP transformation as an HTML-based output file.
I think that I have it figured out. In the future i will have to remember to use the ereg_replace code in the form for open-ended response questions (i.e. string responses) so that I can strip out the hard returns and tabs at the front end instead of the back end.
I have altered the code and it seems to run fine like this:
//Open the file
$fp = fopen("FireS.txt", "r+");
if(!$fp) die ("The file is not there stupid");
//Read the whole file
$data = fread($fp, 122000000);
//Replace excess spaces and hard returns with tabs
$change = ereg_replace("\r\n", "\t", $data);
//Replace Comments:Comments with single comments filed
$change1 = ereg_replace("COMMENTS:COMMENTS:", "Comment:", $change);
//Replace irregular \ characters from form
$change2 = ereg_replace("\\", "", $change1);
//Separate the unique form data by a hard return
$change3 = ereg_replace("date:", "\r\n\r\ndate:", $change2);
//Write the data back to the tail-end of the original file
fwrite($fp, $change3);
//Echo the data back in the browser to check that the code worked
echo $change3;
//Close the file
fclose($fp);
Of course, if you have any suggestions for making it more efficient????