Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想用来wget自动打开一个 URL 并将其保存为csv格式。这是问题所在:
wget
csv
1-我想运行这个命令./mydownload 2011 8 29
./mydownload 2011 8 29
2-wget应该打开网址http://d1.website.com/2011/8/29/MonthlyReport.html?format=1
http://d1.website.com/2011/8/29/MonthlyReport.html?format=1
3-然后将该文件保存到2011_8_29.csv
2011_8_29.csv
如何使用 bash 脚本来做到这一点?还有更简单的解决方案,请说明。
#/bin/bash wget --output-document=$1_$2_$3.csv http://d1.website.com/$1/$2/$3/MonthlyReport.html?format=1
编辑 尝试类似
wget -qO- http://d1.website.com/$1/$2/$3/MonthlyReport.html?format=1 \ | sed 's+<br />++g' > $1_$2_$3.csv