mhasanbulli
Instructor
Hi,
I am having some problems with a single line of awk code. I have .data files and I am trying to manipulate data in one file and write it into other file. This code works in most of the .data files I have. However, it suddenly decides to stop working on some files. The line of code I am using is
When I process [tt]normalized_14_1000.data[/tt] it start doing the calculation but suddenly stops doing what it is supposed to do and produces the following
File [tt]normalized_14_1000.data[/tt] has almost [tt]140.000[/tt] lines of data. There are no values that might cause zero-divisions. I thought maybe something is wrong with the .data file but I re-generated the file. But, I get the same thing at the same position. It is just a weird behavior. I was wondering if there is a solution to this, or, any suggestions that might cause this behavior.
Thank you very much in advance.
Mus.
I am having some problems with a single line of awk code. I have .data files and I am trying to manipulate data in one file and write it into other file. This code works in most of the .data files I have. However, it suddenly decides to stop working on some files. The line of code I am using is
Code:
awk -v t=14 -v s=1000 '{printf "%.20f\n", ($2*$2)*((1/($1**2))+(s/(t**s))*($1**(s-1)))*0.0001;}' normalized_14_1000.data > out.data
When I process [tt]normalized_14_1000.data[/tt] it start doing the calculation but suddenly stops doing what it is supposed to do and produces the following
Code:
.
.
.
0.00009742961186584262
0.00009741012836261867
0.00009739064875556540
0.00009737117304390360
-nan
-nan
-nan
-nan
.
.
.
File [tt]normalized_14_1000.data[/tt] has almost [tt]140.000[/tt] lines of data. There are no values that might cause zero-divisions. I thought maybe something is wrong with the .data file but I re-generated the file. But, I get the same thing at the same position. It is just a weird behavior. I was wondering if there is a solution to this, or, any suggestions that might cause this behavior.
Thank you very much in advance.
Mus.