Last active
July 29, 2021 07:13
-
-
Save iomz/dcbe4b643aee6e0759b0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# download http://scanningtheearth.org/data/[0-9]+ | |
wget -q -O - http://scanningtheearth.org/data | grep "href=\"[0-9]\+\"" | sed "s/^.*href=\"//g" | sed "s/\".*$//g" | xargs -I {} wget -O {}.csv http://scanningtheearth.org/data/{} | |
## 対象のhtmlをダウンロードして、stdoutからpipeする | |
#wget -q -O - http://scanningtheearth.org/data | | |
# | |
## 数字のみを含むhrefがある行をまず抽出して、その前後をトリムする | |
#grep "href=\"[0-9]\+\"" | sed "s/^.*href=\"//g" | sed "s/\".*$//g" | | |
# | |
## できた数字の列からurlとファイル名をして出力 | |
#xargs -I {} wget -O {}.csv http://scanningtheearth.org/data/{} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment