0

I am trying to convert any scientific notation that occurs in column 2 into decimal with out changing the format of the file using BASH.

i have a file that looks like this:

43.83974818    0.67204
50.00000000    0.010022   
55.00000000    0.01
70.00000000    0.01
80.00000000    0.01
90.00000000    0.01
90.00940652    1.80760656
100.00000000    0.15724786
100.01514761    0.09985
101.00000000    0.04
200.00000000    1.05E-5
400.00000000    2.75E-6
800.00000000    1.262E-5
1600.00000000    6.87E-6
1747.75754730    0.01244754
3200.00000000    4.68E-6
5000.00000000    0.00010511
goose goose
  • 86
  • 3
  • 15
  • 2
    [Stack Overflow](http://stackoverflow.com/tour) is a question and answer site for professional and enthusiast programmers. Please show your coding efforts. – Cyrus Mar 16 '18 at 05:46
  • 1
    Try this with GNU `sed`. Works only for negative exponents, though: `sed -r "s/^(\S+\s+)([0-9]+)\.([0-9]+)[eE]-([0-9]+)/echo -n '\10.'; for _ in \$(seq 2 \4); do echo -n 0; done; echo '\2\3'/e" ` – Thomas Mar 16 '18 at 06:26
  • Worked like a charm sed has been a weak link for a long time thank you very much. – goose goose Mar 16 '18 at 21:10

0 Answers0