The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 07-01-2009
barrypitts barrypitts is offline
Registered User
  
 

Join Date: Jul 2009
Location: Dublin, Irelnad
Posts: 3
Converting Exponential values to decimals

Hi,

I have a number of large (500Mb) txt files in the following format:


Code:
  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  9.69441981E+05  1 14  2968.05   3418.00     61.00   61 3.4028235E+38 2 w99-100
  8.05443884E+05  9.69448898E+05  1 14  2968.08   3417.50     62.00   62 3.4028235E+38 2 w99-100
  8.05433466E+05  9.69455815E+05  1 14  2968.11   3417.00     63.00   63 3.4028235E+38 2 w99-100
  8.05423048E+05  9.69462733E+05  1 14  2968.14   3416.50     64.00   64 3.4028235E+38 2 w99-100
  8.05412631E+05  9.69469650E+05  1 14  2968.16   3416.00     65.00   65 3.4028235E+38 2 w99-100
  8.05402213E+05  9.69476567E+05  1 14  2968.19   3415.50     66.00   66 3.4028235E+38 2 w99-100
  8.05391795E+05  9.69483484E+05  1 14  2968.22   3415.00     67.00   67 3.4028235E+38 2 w99-100
  8.05381378E+05  9.69490401E+05  1 14  2968.24   3414.50     68.00   68 3.4028235E+38 2 w99-100
  8.05370960E+05  9.69497318E+05  1 14  2968.27   3414.00     69.00   69 3.4028235E+38 2 w99-100

I would like toprint all the columns but convert the first two columns to decimals e.g. 8.05370960E+05 to 805370.960
Anything I have done has rounded the numbers to the nearest whole number e.g. 8.05370960E+05 to 805371

any help on this would be much appreciated.

Last edited by barrypitts; 07-01-2009 at 12:14 PM..