Suppression de %, €,...

Résolu/Fermé
Apha - 16 avril 2012 à 19:23
 Apha - 17 avril 2012 à 15:31
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...?
A voir également:

1 réponse

mamiemando Messages postés 33093 Date d'inscription jeudi 12 mai 2005 Statut Modérateur Dernière intervention 4 mai 2024 7 752
Modifié par mamiemando le 16/04/2012 à 19:53
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
zipe31 Messages postés 36402 Date d'inscription dimanche 7 novembre 2010 Statut Contributeur Dernière intervention 27 janvier 2021 6 408
16 avril 2012 à 19:59
Salut,

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

;-))
0
mamiemando Messages postés 33093 Date d'inscription jeudi 12 mai 2005 Statut Modérateur Dernière intervention 4 mai 2024 7 752
16 avril 2012 à 20:02
Ah zipe31 :-) Le pro du sed :-)
Le pire c'est que j'aurais pu y penser !

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