[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [HS][BASH]filtrage d' un fichier texte



Gilles MISSONNIER wrote:
ça marche pô, car il affiche des lignes vides si il y a + de 2 lignes vides qui se suivent...

la réponse est dans la question :)

while old=$line && read line; do
     test -z $old && test -n $line  && echo $line
done < fichier

awk ' { if ( old=="" && $0 !="" ) { print }; old=$0 }' <fichier



Reply to: