Greetings,
When I try to execute the following awk command I am extracting the third column (size value) from the file which is given in Bytes (by default). I am getting error while trying calculate total size for all file's records and displaing them in the readable range (Bytes, KB, MB, GB, TB, etc...). I noticed that I am getting error when try to take exponential 10^length(totalsize).
Is there any better way to accomplish this ?
I appreciate for the help!
Thanks.
Alex.
grep 'Size' ${LOGDIR}${BU}_dasd_usage.txt | awk '{ totalsize += $3 } END {print "totalsize value: " totalsize/(10^length(totalsize)) "\n"}'
When I try to execute the following awk command I am extracting the third column (size value) from the file which is given in Bytes (by default). I am getting error while trying calculate total size for all file's records and displaing them in the readable range (Bytes, KB, MB, GB, TB, etc...). I noticed that I am getting error when try to take exponential 10^length(totalsize).
Is there any better way to accomplish this ?
I appreciate for the help!
Thanks.
Alex.
grep 'Size' ${LOGDIR}${BU}_dasd_usage.txt | awk '{ totalsize += $3 } END {print "totalsize value: " totalsize/(10^length(totalsize)) "\n"}'