I have several 'ascii' tables in a directory, some of them have numbers expressed in decimal and some others ones in floating point, as follow:1 1 14231 2 15891 3 0.85e 51 4 0.89e 41 5 8796...Is there a way to convert all the value of the tables in decimal numbers?I heard that using tr editor might be useful but I cant figure out how to operate the conversion.
Convert floating point numbers to decimal numbers
bash;table;floating point
The sed script gets rid of the space after the 'e', and the awk script just prints out each field (multiplying $3 by 1 to convert it to a non-fp decimal number):$ sed -e 's/e /e/g' file | awk '{print $1, $2, $3 * 1}'1 1 14231 2 15891 3 850001 4 89001 5 8796This assumes that the floating point numbers in the file:have an extraneous space after the 'e'omit the '+' for positive exponentsdon't have really large exponents otherwise awk will print them as fp.It's possible to get awk to do the 's/e /e/' transformation (so sed isn't needed) but it's getting late and my brain's tired.  sed | awk is easy and it works.