Getting -nan in output of awk statement
I have 2 files that are created by other processes where I need to divide the value of one file by the value of the other.
I am currently using the following command:
paste file1.txt file2.txt | | awk '{print $2/$1};' > file3.txt
I am getting the correct output but I am also getting a second line that contains -nan. So if file1.txt = 10 and file2.txt = 50 I am getting the following output:
5
-nan
I am very much a newbie to Linux and I am trying to use it for some file manipulation I simply cannot do in Windows. I apologize if my question seems basic. I am guessing the -nan has something to do with the fact I am dividing but I have no idea and haven't found anything yet in my searches.
Thanks
Last edited by sparker1970; 04-05-2012 at 11:11 PM.
|