LoginSignup
2
6

More than 5 years have passed since last update.

青空文庫の書籍をすべてローカルに保存

Last updated at Posted at 2017-12-05

GitHubから入手

git clone https://github.com/aozorabunko/aozorabunko

※10GB近くあるので時間がかかる

作業

  • aozorabunkoというディレクトリが出現

  • cardsディレクトリに移動

cd aozorabunko/cards
  • cardsディレクトリ内のzipファイルをすべてコピーもしくは移動させる.
mkdir bunsho_all
cp */files/*.zip bunsho_all/

解凍

cd busho_all
unzip '*.zip'

文字コードの変更(必要な人だけ)

  • 元の文字コードはShift_JIS
nkf -w --overwrite *.txt

注意

  • 全ファイルを使ってプログラムを書く場合
    • zipを解凍すると,テキストファイルだけでなくディレクトリも少しだけ混じっており,そのディレクトリ内にもテキストファイルが残されているので bunsho_all に移動させる.
2
6
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
6