The awk subtraction giving exponential values.Please help resolve it
Hi friends,
I have a file list1 which has these 2 columns like
I have to put the result of col1 -col2 into another file list2 linewise.
e.g. It gives the below result if use the below code:
I don't want the exponential values
The problem with my code is that it turns the subtraction result into exponential for values greater than 6 digits. How should i modify the awk command (using some formatting features...i tried it but no success) to get the result in the format like given below
Also if i try to convert the above exponential values to integer i use some values like 2.15108e+06 becomes 2151080 instead of required 2151083.
For now i have used the below workaround , But can anyone please tell me how to modify my above awk syntax to achieve it.
I have searched this forum number of times for this ,but no success still.
Regds,
Kunwar
Last edited by Scott; 03-06-2011 at 06:20 AM..
Reason: Please use code tags.
Hi Friends,
My input
Gene1 4.14887050399078e-49
Gene2 5.39999891278828e-10
Gene 2.22108326729483e-11
How do I change the above exponential values to normal values?
Thanks (3 Replies)
I am trying to speed up creating a line by line hash file from a huge file using Perl.
Here is my current (working but too slow) Bash code:
(while read line; do hash=$(echo -n $line | md5sum); echo ${hash:0:32}; done)And here is my Perl code:
perl -MDigest::MD5 -le 'foreach $line ( <STDIN> )... (3 Replies)
I'm using the following command, but how can I avoid printing exponential value (highlighted):-
awk ' BEGIN { OFS=FS="|" } { if(NF>4) $10=int(((3.77*$11)/100 + $11)); } { print } ' infile
CR|20121022|105|GSM|N|SAN|00122|SAN|75082|6.03929e+06|5819880|5794769|25111... (7 Replies)
FileA
F97S 83 530
K569E 531 736
output shud be
F16S
K40E
it is code
sed 's///g' FileA |awk '{print $1-$2+2}'
it will print
16
40
anything can come with this output?? (1 Reply)
I have various numbers that I'm printing out from a statistical summary script. I'd like it to stop using exponential format. Of course, I can use printf with 'd' and 'f' and various parameters to specify a format, but then it has other undesirable effects, like tacking on extra 0's or truncating... (0 Replies)
Hi,
I have a number of large (500Mb) txt files in the following format:
8.05475136E+05 9.69428147E+05 1 14 2968.00 3419.00 59.00 59 3.4028235E+38 2 w99-100
8.05464719E+05 9.69435064E+05 1 14 2968.03 3418.50 60.00 60 3.4028235E+38 2 w99-100
8.05454301E+05 ... (4 Replies)
AWK subtraction in multiple columns
Hi there,
Can not get the following:
input: 34523 934
9485 3847
394 3847
3456 9384
awk 'NR==1 {for (i = 1; i <= NF; i++) {n=$i; next}; {n-=$i} END {print n}' input
output: 21188 first column only,... (2 Replies)
Hi All,
I have 1 million records file. Using awk, I am counting the number of records. But as the number is huge, after crossing a number, awk is displaying it in exponential format.
At the end, I need to verify this count given by awk with expected count.
But as it is in exponential format,... (3 Replies)
Hi.
Is there a way to convert a value outputted as(for example):
4.14486e+06 into a regular format: 4144860
I suppose in plain english i want to move the decimal point 6 places to the right.
please??? (2 Replies)