Aide Linux - Liste de diffusion Ze-Linux hebergée par
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [script] Nombre de mots dans un texte
Sac-Epee Jean-Marc wrote:
Bonjour,
Quelqu'un sait-il comment je pourrais compter le nombre total de mots
dans un texte.
Merci beaucoup d'avance,
JM
re-salut,
wc -w monfic.txt
12 monfic.txt
nb : avec seul les espaces comme separateur de mots par defaut donc
"user:x:uid:gid:com:home:shell" sera vu comme un seul mot et non 7
wc -w fic | cut -d ' ' -f 1
pour isoler le nombre ( cut ici ou awk ou sed... )
mavar=`wc -w fic | cut -d ' ' -f 1`
pour l avoir dans une variable
a+
erwan
--
When all else fails, pour a pint of Guinness in the gas tank, advance
the spark 20 degrees, cry "God Save the Queen!", and pull the starter knob.
-- MG "Series MGA" Workshop Manual
----------------------------------
Informations, désabonnement, règles, obligations sur la liste Aide-Linux :
http://lists.ze-linux.org/howto_ml.html
Liste Herbergee par Over-Link [http://www.over-link.net]
Aide Linux - Liste de diffusion Ze-Linux hebergée par