Skip to content

Instantly share code, notes, and snippets.

@barn

barn/ec.sh

Created Aug 7, 2013
Embed
What would you like to do?
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