Skip to content

Instantly share code, notes, and snippets.

@nukos

nukos/add_date_for_csv.sh

Last active Aug 29, 2015
Embed
What would you like to do?
CSVの行に一括で日付を追加する
# すべての行の先頭に日付を追加
LC_ALL=C sed -i -e 's/^/2014\/12\/08,/g' 2014-12-08.csv
# 先頭行の項目名を日付に修正する
LC_ALL=C sed -i -e '1s/^2014\/12\/08/日付/g' 2014-12-08.csv
# 月ごとにCSVを結合する
cat 2014-12-*.csv > 2014-12.csv
# すべてのCSVを結合する
cat 201*-*-*.csv > all.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment