linux 对csv表格的读写

读:f1,f2,f3 为第1,2,3列

#!/bin/bash
IFS=","
while read f1 f2 f3
do
	/usr/bin/php -f Importskuupcbycsvfile.php importcsv $f1 $f2
done < ../var/import/skuupc.csv

写:

 for (( i=1; i<=$variable; i++ ))
    do
        info=`/usr/bin/php -f exportProducts.php exportGoogleFeedContnet $STOREID  $i`
		#echo $info
        echo -e $info >> $csv
        echo "Page $i done"
    done

php 返回的格式:

"111","fdfdfd","fdfd"\n   "111","fdfdfd","fdfd"\n

$data['MPN'] = sprintf('"%s"',$product->getSku());

你可能感兴趣的:(linux 对csv表格的读写)