Skip to content

Commit

Permalink
output utf8 file
Browse files Browse the repository at this point in the history
  • Loading branch information
azuki774 committed Dec 22, 2024
1 parent bd0b5fb commit 7617cad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 0 additions & 4 deletions build/moneyforward/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ function fetch () {
echo "fetcher start"
python3 -u /src/main.py
echo "fetcher complete"

# utf8 -> sjis
cp -p cf.csv cf.csv.bak && cat cf.csv.bak | iconv -f utf8 -t sjis > cf.csv && rm -f cf.csv.bak
cp -p cf_lastmonth.csv cf_lastmonth.csv.bak && cat cf_lastmonth.csv.bak | iconv -f utf8 -t sjis > cf_lastmonth.csv && rm -f cf_lastmonth.csv.bak
}

function create_s3_credentials () {
Expand Down
13 changes: 9 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
### output CSV
例:
```
計算対象,日付,内容,金額(円),保有金融機関,大項目,中項目,メモ,振替,削除
,07/16(火),ローソン,-291,三井住友カード,食費,食料品,,,
,07/16(火),GITHUB,-158,JCBカード,通信費,情報サービス,,,
,07/10(水),マクドナルド,-600,三井住友カード,食費,外食,,,
"計算対象","日付","内容","金額(円)","保有金融機関","大項目","中項目","メモ","振替","ID"
"1","2024/12/12","マクドナルド","-600","三井住友カード","食費","外食","","",""
"1","2024/12/12","JR東日本モバイルSuica●","-3,000","三井住友カード","","","","","
```
- moneyforward 公式との差異は下記
- 計算対象は無条件で1にする
- ID 部分は取得不可なので、空文字にする
- 振替欄も正しく入らない(空文字)
- ただし、文字コードは UTF8 のままにする(公式はSJIS)


### 出力先
- コンテナ内デフォルト: `/data/YYYYMM/YYYYMMDD/cf.csv`, `--lastmonth` 付与時は、`/data/YYYYMM/YYYYMMDD/cf_lastmonth.csv` も出力。

0 comments on commit 7617cad

Please sign in to comment.