Created
February 14, 2012 06:34
-
-
Save hyoshiok/1824278 to your computer and use it in GitHub Desktop.
unzip yammer message file to csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# unzip csv file | |
# | |
# usage | |
# $ ./unzip_csv.sh <export_message.zip> | |
# | |
# input format message_export_yyyymmdd-yyyymmdd.zip | |
# output format data/messages_yyyymmdd-yyyymmdd.csv | |
# | |
# 2/14/2012 hirotaka.yoshioka@mail.rakuten.com | |
# | |
ZIPFILE=$1 | |
CSVFILE=`basename $ZIPFILE|sed -e "s/message_export_\([0-9]\{8\}\-[0-9]\{8\}\).zip/data\/messages_\1.csv/g"` | |
echo "ZIPFILE = $ZIPFILE" | |
echo "CSVFILE = $CSVFILE" | |
unzip -p $ZIPFILE > $CSVFILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment