Compter le nombre de ligne dans un fichier texte sous Windows

Compter le nombre de ligne dans un fichier texte sous Windows - Divers - Programmation

Marsh Posté le 28-11-2005 à 15:21:51    

J'ai un fichier (c:\toto.txt) qui contient plusieurs lignes sous Windows.
 
Quelle commande et syntaxe faut-il utiliser pour compter le nombre de ligne, qui sera renvoyer dans un autre fichier?
 
Merci d'avance
 

Reply

Marsh Posté le 28-11-2005 à 15:21:51   

Reply

Marsh Posté le 28-11-2005 à 16:56:06    

Il est facile d'écrire un petit programme C ou VBS pour faire ça.
Sinon, il existe l'astuce suivante

FIND /C /V "chaine_improbable" "toto.txt" >"autrefichier.txt"

(Faire FIND /? pour comprendre la signification des flags C et V)

Reply

Marsh Posté le 28-11-2005 à 17:24:28    

Merci beaucoup!!!!

Reply

Marsh Posté le 28-11-2005 à 18:22:42    

Sinon il y a sûrement des ports de wc sous Windows :o


Message édité par masklinn le 28-11-2005 à 18:23:06

---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r
Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed