クラスメソッドの請求書ファイルから情報抽出をしてファイル名を変更するツールです。請求書ファイルが20200511-100101.pdf
のようなファイル名でプロジェクトごとに来るので、情報整理を自動化する為に作成しました。
※2020年11月時点のクラスメソッドの請求書のフォーマットに対応しているので、フォーマットが変われば適切に動作しなくなる可能性がある。正規表現で請求書から文言を抽出している。
GitHubよりクローンして npm install
。node の v12.10.0 で動作確認しています。必要なモジュールが一回で入らないときがあるので、そのときは個別に以下のモジュールをインストールしてください。
- csv-writer
- pdf-parse
index.js
と同じ階層にdocs
というディレクトリを作り、その中に請求書ファイルを格納してください。その後、以下コマンドで実行します。
- node index.js
docs
配下の全ての請求書ファイルの名前が<yyyy年m月_プロジェクト名>に変わるdocs
配下の全ての請求書ファイルのプロジェクト名、請求額をCSVファイルに書き出す