Commit 5937d557 authored by Julius Wu's avatar Julius Wu

fix 5

parent 8955a7e7
#!/bin/bash
echo "Customer: Hours"
cat timesheet.csv | awk -F"," ' {if (($7 == "Y")) print; } ' | cut -d ',' -f5,8
awk -F, '{
arr[$5]+=$8
}
END{
for(key in arr) print key , arr[key]}' timesheet.csv | sort -u
cat timesheet.csv | awk -F"," ' {if (($7 == "Y")) arr[$5] += $8;} END{for(key in arr) print key , arr[key]} '
declare -i totalhours=0
while read LINE
do
......@@ -11,4 +15,6 @@ do
hours=$(echo $LINE | awk -F, '{print $8}')
[[ $billFlag == "Y" ]] && totalhours=$(( $totalhours + $hours ))
done < ./timesheet.csv
echo "Total: $totalhours"
\ No newline at end of file
echo "Total: $totalhours"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment