LoginSignup
2

More than 5 years have passed since last update.

時間がかかるコマンドを GNU parallel で 並列実行する

Posted at

LibreOffice の soffice コマンドを使うと Word ファイルから文章を抽出してテキストファイルに変換できるのですが、遅いです。

変換対象の Word ファイルが 100 ファイルぐらいあったので手軽に bash の for f in *.doc *.docx で回したのですが遅すぎたので GNU Parallel を使って並列化しました。

$ parallel -j 5 soffice --headless --convert-to txt {} --outdir ./text ::: *.doc *.docx

-j 5 で 5 ファイルずつ変換されます。

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