Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

*Free UNIX Filter before Automatic translation* Votre compagnon

0 views
Skip to first unread message

idgu...@interserv.com

unread,
Apr 2, 1996, 3:00:00 AM4/2/96
to
#Asked by many users who contacted me, here is a free copy of my
#UNIX Filter to remove all codes and unwanted strings in a file before
#sending it to DPTL/Transcend Automatic Translation System
# Votre compagnon
#
# Visit my page at: http://iquest.com/~btatro/lang.html
#
#Filtre UNIX créé pour eliminer tout code d'un fichier avant le
#traitement en traduction automatique.
#
# idgu...@interserv.com - Votre compagnon
#for anotehr database query script see my posted messages in this news group.
#
# Script begins here:
# sed 's/<[A-Z]*[A-Z]>//g' filename | sed 's/<\/[A-Z]*[A-Z]>//g'
# sed 's/<[A-Z]*[A-Z]>//g'
# sed -e to add more than one sed
#sed -e 's/yourcodes>.*<\/yourcodes//g' -e 's/yourcodes>.*<\/yourcodes//g' -e
's/yourcodes>.*<\/yourcodes//g'
node=`uname -n`

testnode ()
{
if [ $node = your_node ]
then
echo "Invalid option!"
echo "You are on your_node - No DocteurDomi for you -"
sleep 2
else
echo "Réexécuter en donnant un nom de fichier à filtrer valide ! "
/usr/ip32/vt200/vterm/ -xs DocteurDomi -c -f /the path you want/files
fi
}

if [ "$1" = "" ]
then
echo "Il faut entrer un nom de fichier à filtrer"
echo "Exemple: filtrer le_ficher"
testnode
break
else
/bin/ls $1 > /dev/null
if [ "$?" = 0 ]
then
#next: the -e option can be used to limit the number of seds
echo " [33mElimination des lignes contenant what_you_want [0m"
sed '/what_you_want/d' $1 | sed '/what_you_want/d' | sed '/what_you_want/d' > FICHIER0
echo " [33mElimination des lignes contenant : INDEXTOP - COLITEM - SECTION
ID [0m"
sed '/what_you_want/d' FICHIER0 | sed '/what_you_want/d' | sed '/SECTION ID/d' > FICHIER
echo " [33mElimination des lignes contenant : what_you_want [0m"
sed '/what_you_want/d' FICHIER | sed '/what_you_want/d' | sed '/HELP/d' | sed
'/what_you_want/d' > FICHIER1
echo " [33mElimination des lignes contenant : what_you_want [0m"
sed '/what_you_want/d' FICHIER1 > FICHIER2
echo " [36m what_you_want; remplacé par: what_you_want [0m"
echo " [32mFiltrage de: what_you_want - TITLE et de tout autre code [0m"
sed -e 's/what_you_want/: /g' -e 's/<[^\>]*>/ /g' FICHIER2 > SORTIE
/usr/bin/pg -p " q pour terminer pagination >>" SORTIE
echo " [36mNettoyer les fichiers temporaires (y/n) ? [0m"
read rep
if [ "$rep" = "y" ]
then
echo " [32mTous les fichiers temporaires sont effacés [0m"
echo "Le fichier temporaire à traduire est: SORTIE"
rm FICHIER*
else
echo " [33mFichier à traduire est: SORTIE [0m"
echo " [36mLes fichiers temporaires ne sont pas effacés [0m"
fi
else
echo " [32mFichier $1 n'existe pas dans répertoire en cours [0m"
testnode
break
fi
fi

0 new messages