7 foreach ($argv as $arg ){
8 if ( preg_match(
'/\.csv$/', $arg) ){
13 if ( preg_match(
'/\.php$/', $arg ) )
continue;
24 fwrite( STDERR,
"No output path was supplied.\n");
30 fwrite(STDERR,
"No input CSV file was specified.\n");
39 fwrite(STDERR,
"The Input file $inputPath could not be opened for reading.\n");
50 while ( $row = fgetcsv(
$fp) ){
51 $key = array_shift($row);
53 if ( isset($row[$i]) and !empty($row[$i]) ){
54 $dicts[$file][$key] = $row[$i];
60 foreach (
$dicts as $file => $contents ){
63 foreach ($contents as $key=>$val){
64 fwrite($df, $key.
' = "'.str_replace(
'"',
'"XATAFACEQ"', $val).
'"'.
"\r\n");
71 fwrite(STDOUT,
"Conversions complete.\n");