I have a file that has a bunch of numbers ranging from .000000001 to 1000.
I'm trying to turn it into xml that looks something like this (where the number is multiplied by 10^7 in the name portion:
<TickTable Name="Fut_2500">
<Tick Size="0.0025"/>
</TickTable>
I'm using the following awk command (in cygwin):
awk '{print "<TickTable Name=\"Fut_" $0 * 1000000 "\">\n\t<Tick Size=\""$0 * 1 "\"/>\n</TickTable>"}' tick.txt
The formatting lookgs good, however, that results in the TickSize number being formatted with the 'e' notation such as 5e-07...:
<TickTable Name="Fut_0.5">
<Tick Size="5e-07"/>
</TickTable>
So I tried running the same command, but without multiplying the second instance of the number by * 1:
awk '{print "<TickTable Name=\"Fut_" $0 * 1000000 "\">\n\t<Tick Size=\""$0 "\"/>\n</TickTable>"}' tick.txt
But now, the formatting becomes all messed up, where if I > to a file, it looks like:
<TickTable Name="Fut_0.5">
<Tick Size=".0000005
"/>
and looks like this in cygwin:
<TickTable Name="Fut_5">
"/> <Tick Size=".000005
</TickTable>
Why does this happen? How can I fix this? (Easiest way is probably to stop the auto-formatting of the decimals in 'e' notation?