Skip to content

Instantly share code, notes, and snippets.

@nukos
Last active August 29, 2015 14:13
Show Gist options
  • Save nukos/0fcc62c87f39a4cb8ae3 to your computer and use it in GitHub Desktop.
Save nukos/0fcc62c87f39a4cb8ae3 to your computer and use it in GitHub Desktop.
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