Hi all

I want to append a text file data to an already existing excel file.the text file will be of the following format:

111111868167|Dead North Friday Night OCT 10th |18.5|Amber|Follensbee|Windsor|VT|05089|08/07/08 11:30am
111111868177|Dead North Friday Night OCT 10th |18.5|Amber|Follensbee|Windsor|VT|05089|08/07/08 11:30am
111111868187|Dead North Friday Night OCT 10th |18.5|Amber|Follensbee|Windsor|VT|05089|08/07/08 11:30am
111111868197|Dead North Friday Night OCT 10th |18.5|Amber|Follensbee|Windsor|VT|05089|08/07/08 11:30am
111111868207|Dead North Friday Night OCT 10th |18.5|Amber|Follensbee|Windsor|VT|05089|08/07/08 11:30am
112120127382|Dead North Friday Night OCT 10th |25|Heather|Davio|St. Johnsbury|VT|05819|09/14/08 05:19pm

excel sheet will have same columns.

another problem is to change data or overwrite a cell value in excel sheet.

Please help me...it will be a graet help

thanks in advance

I say you parse it into an array, then work with that, when you are finished just overwrite it.

$excelfile = file("/path/to/tile.csv");
for($i = 0; $i < count($excelfile); $i++)
	$row = explode("|", $excelfile[$i]);
	foreach($columnheaders as $columnheader)
		$excelfile[$i][$columnheader] = $row[0];

The excel or csv file will be converted into this for each row


Then you can just use array functions to search through the array and you can overwrite different cells of the array and then when you are done just loop through it and overwrite the file.

I will even bet that if you are creative enough and you have the time on your hands that you can create a class that will parse standard select, update and insert statements so that when you do finally decide to move to a database, there won't be much effort involved