Skip to content

Instantly share code, notes, and snippets.

@hotta
Created March 21, 2018 04:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hotta/d7a5315ab0c92e0f50a789f43d952c32 to your computer and use it in GitHub Desktop.
Save hotta/d7a5315ab0c92e0f50a789f43d952c32 to your computer and use it in GitHub Desktop.
インターネットバンキングで取得した入出金明細のCSVをまともにするスクリプト
#!/bin/bash
cat $1 | \
nkf -Sw -Lu -Z4 -X | \
sed -e '1,5d' | \
head -n -2 | \
sed -e 's/","/\t/g'
-e 's/"//g' \
-e 's/フリカエ/振替/g' \
-e 's/コクミンネンキン/国民年金/g' \
-e 's/ホケンリヨウ/保険料/g' \
-e 's/キヨウカイケンポ/協会けんぽ/g' \
-e 's/ロ-ンヘンサイホケン/ローン返済保険/g' \
-e 's/ナガサキダイ/長崎大学/g' \
-e 's/ツウチヨウ/通帳/g' \
-e 's/ガイコクソウキ/外国送金/g' \
-e 's/リソク/利息/g' \
-e 's/キヨウサイ/共済/g' \
-e 's/アメツクス/Amex/g' \
-e 's/ソニ-セイメイ/ソニー生命/g' \
-e 's/ゼイキン/税金/g' \
-e 's/シヨトクゼイ/所得税/g' \
-e 's/オ-エムシ-カ-/OMCカード/g' \
-re 's/^([0-9]+)年([0-9]+)月([0-9]+)日/\1\/\2\/\3/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment