Skip to content

Instantly share code, notes, and snippets.

@barn
Created August 7, 2013 04:06
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save barn/6171111 to your computer and use it in GitHub Desktop.
Simple to ExpenseCloud CSV hacking.
#!/bin/sh
CSVFILE=$1
NAME='Carlos Danger'
if [ -z "$CSVFILE" -o ! -e "${CSVFILE}" ]
then
echo 'Need a real file'
exit 10
fi
AWK='{print $1 "," $7 "," $3 '
AWK="${AWK} \",${NAME}\" }"
awk -F , < "${CSVFILE}" "${AWK}" \
| sed 's/ [0-9][0-9]:[0-9][0-9]:[0-9][0-9] [AP]M -[0-9]*,/,/' \
| grep 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment