Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2048083
  • 博文数量: 354
  • 博客积分: 4955
  • 博客等级: 上校
  • 技术积分: 4579
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-21 11:46
文章分类

全部博文(354)

文章存档

2015年(1)

2013年(4)

2012年(86)

2011年(115)

2010年(67)

2009年(81)

我的朋友

分类:

2009-08-07 15:01:42

1、
抓取网页更改编码

#!/bin/bash
url=$1
temp=html
curl $1|iconv -f gbk -t utf-8 -o $temp
2、
导入数据库

#!/bin/bash
myfile=$1
while read line
do
song=`echo $line|awk '{print $1}'`
singer=`echo $line|awk '{print $2}'`
mysql -uroot -D mp3 -e "set names utf8;insert into m_manage_toplist(song_name,singer_name) values ('$song','$singer');"
done < $myfile
阅读(1196) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~