Bonjour,

Je ne connais pas le langage de commande Windows, mais j'aurai un script UNIX à adapter sur Windows.

#!/bin/ksh
for NLIGNE in $(grep -n "<PATROL>" index.html | awk '{ FS=":" ; print $1}'| sed "s/://g") #Numéro de ligne
do
STATUT=$(head -${NLIGNE} index.html | tail -1 | cut -c 50-51) #statut
SERVEUR=$(head -$(expr ${NLIGNE} - 9 ) index.html | tail -1 | awk -F . '{ print $1}' | awk -F / '{ print $3}') #Ligne du nom serveur
VERSION=$( grep $SERVEUR index.html | grep version | awk '{ FS=">" ; print $6}' | sed "s/<\/TD>//g") # version
echo "${SERVEUR} Version:${VERSION} Statut:${STATUT}"
done


En gros j'ai le résultat d'un wget d'une url de contrôle dans un fichier index.html et je dois récupérer un certains nombre d'info. Le nom des serveur, leurs version applicatives et le statut patrol.

au final ça me donne un truc genre :
toto1 Version:v1 Statut:OK
toto2 Version:v1 Statut:OK
toto3 Version:v1 Statut:OK
toto4 Version:v1 Statut:OK

Comment puis je coder ça sous Windows ? est ce possible en .bat ou faut il attaquer du perl ou du python ?

Merci d'avance,
Didier