Converting cents to euros

fab -  
 sddf -
Hello,

I have a file containing lines with a field separator of ";".
Some identified fields contain prices in cents and I want to convert them to euros.
How can I insert a comma before the last two digits of these fields?
Example line:
article1;1234500;in stock;567890
article2;987600;out of stock;3456730
.
.

Fields 2 and 4 need to be processed to obtain:
article1;12345,00;in stock;5678,90
article2;9876,00;out of stock;34567,30

Do you have any ideas?

Configuration: Windows 7 / Firefox 19.0

2 answers

  1. walidovich_85 Posted messages 698 Status Member 73
     
    Hello,

    is it first about a file accessed by Java, C, PHP... or simply Excel?
    5
    1. fab
       
      Hello,

      it will be accessed through Excel.
      0
    2. fab
       
      the line actually contains about fifty fields, about ten identified fields need to be transformed, the others remain unchanged:
      some prices are at 0!
      I am still looking
      if I find something I will communicate
      0
    3. fab
       
      Well, a friend helped me:
      sprintf("%.2f",$i/100) in an awk

      thank you
      0