Search Results

Search: Posts Made By: Rapcher
1,515
Posted By agama
awk -F ":" -v project="${1:-1}" ' $2 == project {...
awk -F ":" -v project="${1:-1}" ' $2 == project { hours += $3; } END { printf( "total hours for project %d: %.2f\n", project, hours ); }' input-file


Assumes this is running as in a script where...
1,515
Posted By vgersh99
awk -F: '{a[$2]+=$3}END {for(i in a) print "Total...
awk -F: '{a[$2]+=$3}END {for(i in a) print "Total hours for project " i ": " a[i] }' myInputFile
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 02:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy