Suppression de %, €,...

Résolu
Apha -  
 Apha -
Bonjour,

J'ai cette table

CA_LIV TAUX_SERVICE_VOLUME
13 673 € 10%
0 € 0%
38 841 € 10%
10 296 € 100%
9 562 € 7%
100 919 € 4%
52 509 € 3%
24 531 € 102%
88 960 € 2%

Je veux enlèver les € et les %... c'est à dire l'avoir sous ce format:

CA_LIV TAUX_SERVICE_VOLUME
13 673 10
0 0
38 841 10
10 296 100
9 562 7
100 919 4
52 509 3
24 531 102
88 960 2

Quelqu'un pourrait-il m'aider...?

1 réponse

  1. mamiemando Messages postés 33228 Date d'inscription   Statut Modérateur Dernière intervention   7 944
     
    Il suffit de faire un sed, non ?

    (mando@aldur) (~) $ cat toto.txt
    CA_LIV   TAUX_SERVICE_VOLUME 
    13 673 € 10% 
    0 €      0% 
    38 841 € 10% 
    10 296 €         100% 
    9 562 €  7% 
    100 919 €       4% 
    52 509 €         3% 
    24 531 €         102% 
    88 960 €         2% 
    
    (mando@aldur) (~) $ sed -i 's/%//g' toto.txt  
    
    (mando@aldur) (~) $ sed -i 's/€//g' toto.txt  
    
    (mando@aldur) (~) $ cat toto.txt  
    CA_LIV   TAUX_SERVICE_VOLUME  
    13 673  10  
    0        0  
    38 841  10  
    10 296   100  
    9 562    7  
    100 919         4  
    52 509   3  
    24 531   102  
    88 960   2


    Bonne chance
    1
    1. zipe31 Messages postés 34620 Date d'inscription   Statut Contributeur Dernière intervention   6 501
       
      Salut,

      sed -i 's/[€%]//g' toto.txt 

      ;-))
      0
    2. mamiemando Messages postés 33228 Date d'inscription   Statut Modérateur Dernière intervention   7 944
       
      Ah zipe31 :-) Le pro du sed :-)
      Le pire c'est que j'aurais pu y penser !

      Merci de ta contribution !
      0
    3. Apha
       
      Super merci a tous...pr votre aide
      0