URL: https://linuxfr.org/forums/programmation-shell/posts/script-awk Title: script awk Authors: By ZeB Date: 2005年06月21日T11:47:51+02:00 Tags: Score: 0 Bonjour à tous, Voila, je pense que la meilleure facon de solutionner mon probleme serait d'utiliser un script awk. Je vous expose le 'probleme' : J'ai un fichier (input) contenant des lignes comme suis : /monsite/monpath/monsouspath/monsoussouspath/monfichier /monsite/monpath/monsouspath/monsoussouspath/ /monsite/monpath/monsouspath/monsoussouspath/unautrefichier /monsite/monpath/monsouspath/monsoussouspath/encoreunautrefichier /monsite/monpath/monsouspath/monsoussouspath/ /monsite/monpath/monsouspath/monsoussouspath/ /unautresite/monpath/monsouspath /unautresite/monpath/monsouspath/unfichier et je voudrais que mon script awk matche toutes les lignes contenant "/monsite/monpath/monsouspath" et que la ligne ne se termine pas par un "/" (et donc se termine par un nom de fichier) et que ce soit dirigé vers un autre fichier output. Je sais qu'on pourrais le faire en shell, awk, perl etc etc ... d'après vous quelle serait la meilleure solution sachant que le fichier input peut contenir environ 5000 lignes. Merci à tous de votre aide :-)

AltStyle によって変換されたページ (->オリジナル) /