Last active
July 30, 2016 09:46
-
-
Save nakaly/901c832199eaba58cf16dfefba3c7500 to your computer and use it in GitHub Desktop.
青空文庫の文書リストcsvから全作品をダウンロードして、難易度を計算する
This file contains 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
#!/bin/bash | |
while read -r line | |
do | |
url=`echo $line | awk -F ',' '{print $46 }' | sed -e 's/\"//g'` | |
curl -LOk $url > /dev/null 2>&1 | |
if [ $? -ne 0 ] | |
then | |
continue | |
fi | |
file_name=`echo $url | awk -F '/' '{print $7}' | sed -e 's/\"//g'` | |
new_file_name=`echo $file_name | sed -e 's/zip/txt/g'` | |
unzip -c $file_name | nkf -w > $new_file_name | |
done < $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment