Re: Which tool for this report?
- From: Cyrus Kriticos <cyrus.kriticos@xxxxxxxxxxxxxx>
- Date: Sun, 26 Aug 2007 11:46:56 +0200
Cyrus Kriticos wrote:
Michael DeBusk wrote:[...]
The last thing for me to do is get it to look like this:
Code Complete Incomplete
10445 1 0
10732 5 1
11468 5 0
10233 4 2
A solution with bash:
[...]
few changes:
- changed printf format and removed one if
- replaced variables $word and $i
--- cut here ---
#!/bin/bash
FILE="complete.dat"
read_file ()
{
while read code number; do
case $code in
Complete)
let c[$number]=c[$number]+1
;;
Incomplete)
let i[$number]=i[$number]+1
if [ -z "${c[number]}" ]; then c[$number]=0; fi
;;
esac
done < "$FILE"
}
dump_arrays ()
{
echo "Code Complete Incomplete"
for j in ${!c[@]}; do # yeah
printf "%5d %9d %11d\n" $j ${c[$j]} ${i[$j]}
done
}
read_file
dump_arrays
--- cut here ---
--
Best | "Was bekommt man/frau, wenn man/frau Software kauft?
regards | Nichts außer einem Haufen Nullen und Einsen."
Cyrus | -- aus d. Lizenzvereinbarung von Spybot Search&Destroy
.
- References:
- Which tool for this report?
- From: Michael DeBusk
- Re: Which tool for this report?
- From: Cyrus Kriticos
- Which tool for this report?
- Prev by Date: Re: Which tool for this report?
- Next by Date: Re: Which tool for this report?
- Previous by thread: Re: Which tool for this report?
- Next by thread: Re: Which tool for this report?
- Index(es):
Relevant Pages
|