[px:tech] Expression régulière

Patrick Pouget forums.info at patrick.pouget.name
Ven 11 Aou 10:09:02 CEST 2023


Merci.

On oubli trop souvent awk. Peut être parce que ça gère les lignes
indépendament, mais c'est ce que je veux

On Thu, 2023-08-10 at 00:07 +0200, l0f4r0 at tuta.io wrote:
> Hello,
> 
> Pas besoin de regex.
> 
> awk '{ for(i=2;i<=NF;i++) { if($i!="deleted") { for(j=i+1;j<=NF;j++)
> { if($i==$j) { $j="deleted" } } } }; for(i=1;i<=NF;i++) {
> if($i!="deleted") { printf "%s ",$i }; if (i==NF) { printf "\n" } }
> }' input.txt
> 
> l0f4r0
> _______________________________________________
> tech mailing list
> tech at lists.parinux.org
> https://lists.parinux.org/listinfo/tech




Plus d'informations sur la liste de diffusion tech