Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2659 connectés 

  FORUM HardWare.fr
  Programmation
  Shell/Batch

  remplacer [FI] par un espace à l'aide de sed

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

remplacer [FI] par un espace à l'aide de sed

n°1154025
astrolane
Posté le 19-07-2005 à 18:25:01  profilanswer
 

Bonjour,
 
Dans un script shell, je cherche à remplacer la chaine [FI] (4 caractères) par un espace.
La commande SED est donc de circonstance.  
$ cat monfichier | sed s/???????????
En fait, ce qui me cause le problème, ce sont les crochets qu'il faudrait considérer comme des caractères.
 
Merci pour vos futures réponses.
 

mood
Publicité
Posté le 19-07-2005 à 18:25:01  profilanswer
 

n°1154048
wackevat
Posté le 19-07-2005 à 19:17:48  profilanswer
 

:hello:
 
\ comme caractère d'échappement il me semble.

n°1154058
astrolane
Posté le 19-07-2005 à 19:33:42  profilanswer
 

OK c'est cool merci !
et pour le remplacer par l'espace , sais tu la syntaxe pour le caractere " " ?
 
Merci d'avance

n°1154060
wackevat
Posté le 19-07-2005 à 19:52:14  profilanswer
 

s/chain_a_remplacer/ /
 
:)
 

Citation :

man sed
      s/regexp/replacement/
      Attempt  to match regexp against the pattern space.  If success-
      ful,  replace  that  portion  matched  with  replacement.   The
      replacement may contain the special character & to refer to that
      portion of the pattern space  which  matched,  and  the  special
      escapes  \1  through  \9to refer to the corresponding matching
      sub-expressions in the regexp.

n°1154063
astrolane
Posté le 19-07-2005 à 20:00:48  profilanswer
 

dernière question  : comment remplacer une chaine par le retour chariot par SED, et je te laisserais tranquille.
 
Merci ;-)

n°1154064
astrolane
Posté le 19-07-2005 à 20:04:40  profilanswer
 

c'est bon, j'ai trouvé ! te billes pas !

n°1154071
wackevat
Posté le 19-07-2005 à 20:16:02  profilanswer
 

:)
 
@+


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  Shell/Batch

  remplacer [FI] par un espace à l'aide de sed

 

Sujets relatifs
pb essai espace membreBesoin d'aide (pour rendre ma page potable sur firefox)
demande d'aide pour un site internetAide en HTML
[D4] Ds quel fichier du cd de D4 cette aide précise ?Problème espace table
Script CGI > Besoin d'aideAide pour une boucle (niveau nul)
aide TCL/tk[xsl-xml] à l'aide
Plus de sujets relatifs à : remplacer [FI] par un espace à l'aide de sed


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR