Home

zhangyiqun

Thoughts, stories and ideas.

Notes Blog Archives About
19 Nov 2010

数据库内容格式转换

转换成JS的可识别形式,没有现成的东西拿来就用,只能自己处理了,很麻烦。该睡觉了,有空详细展开说

y=-1;for i in `mysql -h127.0.0.1 -uroot -e “SET NAMES ‘utf8’;select * from room.citys” | awk ‘{printf(“{\”CityId\”:\”%s\”,\”CityName\”:\”%s\”\n”,$1,$2) }’`; do let y+=1;echo -n $i;awk -F, “NR==$y{print $1}” aaa; done

Notes Blog Archives About