exponential format

awk -F"\t" -vv1=$name 'BEGIN{OFS="\t"} {gsub ("http://www."v1".com","",$6);print $1"\t-\t-","["$4,$5"]",$6,$7,$9,$2,$14,$15"\t""Apache=-\t-",$8*1000000"\t-\t-\t-\tdeflate=-\trmt=-"}' file.txt > a.txt

file.txt

144.130.7.153   www.chi.com      -       18/Jul/2010:00:00:00    +0000   GET http://articles.chi.com/article.xml?url=http://www.chicagotribune.com/chi-0.link  HTTP/1.1 404     0.269   495     0       0       -               -        Jakarta+Commons-HttpClient/3.0.1        TCP_MISS

From the above line, the value $8*100000, some values are converting the number in exponential format.

How to avoid that

---------- Post updated at 11:23 AM ---------- Previous update was at 10:11 AM ----------

awk -F"\t" -vv1=$propertyname 'BEGIN{OFS="\t"} {gsub ("http://www."v1".com","",$6);print 0.001*1000000}' file.tsv  >  tmp

Please tell me why the values greater than 1 are causing this problem

Suppose if the value is 1.001 when mulitpled by 1000000 which print 1.001e+06

How to avoid that. Please tell me

Hi.

Try using printf, instead of print.

i.e.

$ echo 1.001e+06 | awk '{print}'
1.001e+06

$ echo 1.001e+06 | awk '{printf "%ld\n", $1}' $1}'
1001000

Thanks, But how to use in the below command

awk -F"\t" -vv1=$name 'BEGIN{OFS="\t"} {gsub ("http://www."v1".com","",$6);print $1,$8*1000000}' abc.tsv  >  tmp

My best guesstimate would be to replace:

print $1,$8*1000000

with

printf "%s %ld\n", $1, $8*1000000

(assuming $1 is the IP address(?), or a string.