Thanks, that set me in the right direction! Thanks again for your assistance. Incidentally, is strpos case-insensitive?
# get data files in an array
$new_filestructureData = array();
foreach($filestructureData as $key=>$val)
{
if(strpos($val['name'], 'Schema') === FALSE)
{
// schema wasn't found
$new_filestructureData[$key] = $val;
//get name of each data file and assign its path
$datafile_path = $pathData."/".$val['name'];
//open the file for reading
$fd = fopen ($datafile_path, "r");
$contents = fread ($fd,filesize ($datafile_path));
fclose ($fd);
$delimiter = "\n";
//explode into array
$splitcontents = explode($delimiter, $contents);
$counter = "";
//print_r($splitcontents);
$counter = "";
//print_r($splitcontents);
//read through array
foreach ( $splitcontents as $key => $value )
{
$counter = $counter+1;
//echo "<b>Split $counter</b><br />";
//$contentsarray = explode("\n", $value);
$delimiter='|';
$newDelimiter=',';
//'data1,data2,data3'
$data = str_replace($delimiter,$newDelimiter,$value);
$data = trim($data);
//$line = split(",", $data);
//print_r($line);
$insert = "INSERT INTO $data_table(".$dataFields.") VALUES ('".$data."')";
echo $insert."<p />";
//$result = mysql_query($insert,$db);
} // END foreach ( $splitcontents as $key => $value )
}
}