I say you parse it into an array, then work with that, when you are finished just overwrite it.
<?
$columnheaders = explode("|", "BARCODE|TITLE|PRICE|CUSTOMER_FIRST_NAME|CUSTOMER_LAST_NAME|CITY|STATE|ZIP|PURCHASE DATE");
$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];
array_shift($row);
}
}
/*
The excel or csv file will be converted into this for each row
$excelfile = array(0=>array("BARCODE"=>"BARCODE", "TITLE"=>"TITLE", "PRICE"=>"PRICE", "CUSTOMER_FIRST_NAME"=>"CUSTOMER_FIRST_NAME", "CUSTOMER_LAST_NAME"=>"CUSTOMER_LAST_NAME", "CITY"=>"CITY", "STATE"=>"STATE", "ZIP"=>"ZIP", "PURCHASE DATE"=>"PURCHASE DATE"));
*/
?>
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