Bonjour,
J'ai une commande linux grep que je voudrais transformer sous dos.
La commande est la suivante : grep "toto\|titi" nomfichier.txt > nomfichier2.txt
Cette commande copie toutes les lignes du fichier nomfichier.txt qui contiennent la chaîne de caractères toto ou titi dans le fichier nomfichier2.txt
quelqu'un peut-il m'aider à transformer cette commande sous dos.
Merci.
Je veux faire un script .bat exécuté quotidiennement sur un serveur windows. La commande grep fonctionne sur linux.
D'après mes recherches sur divers forum la commande pourrait ressembler à ça : for /f "tokens=1,* delims=" %%i in ('type c:nomfichier.txt ^| find /i "titi"') do echo %%i> fgo.txt
Mon problème avec cette commande est qu'il m'écrit que la dernière ligne qu'il trouve alors que je peux en avoir plusieurs.
Si quelqu'un a une piste ...
Copyright 1988, 1992-1999, 2000 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
C:\>
(C'est du Windows ça!)
alokkin
tourner 7 fois la langue ...
Posté le 28-07-2017 à 15:10:00
oui, et tu as find ou findstr sous windows ... voire, tu as maintenant, sous windows 10, un GNU bash
---------------
Burn the museum, wipe your ass with the Mona Lisa, this way, at least, God will know your name.