ok, now the questino changed almost completely ^^
You now need to calculate, given numbers, how many % they represent relative to the number 600.
Here is a revised version.
I let my old answer below for historical reason ^^
new answer:
awk ' { printf "%s %.2f%\n",$1,($1/600)*100; }' numbers.txt
ie, assuming the file "numbers.txt" only contain 1 column with a number between 0 and 600, it just print the number, and in the next column the % it represents with regard to 600. I could simplyfy the 2nd calculation as ($1/6)"%" but it would, in my opinion, take out the important information out of the script.
on your new example data it now outputs:
459 76.50%
455 75.83%
463 77.17%
old answer:
If you really need to calculate the percentage, then it would be something like:
awk '
{ # each line is read and stored, and the sum is computed also.
original[NR]=$0 ; #store the current line (line NR) in the "original[]" tab
sum+=$1 ; #and compute the sum of the 1st column
}
END { #at the END, ie after we processed the whole file
for(line=1;line<=NR;line++)
{ printf "%s %.2f%\n",original[line],original[line]/sum*100 ;
}
} ' numbers.txt
something like this should compute the % and put it next to the number (with 2 fractionnal digits)
on your given example it outputs:
12 5.36%
23 10.27%
35 15.62%
67 29.91%
87 38.84%