• [^] # Re: un awk tout bête ?

    Posté par . En réponse au message Équivalent tableau croisé dynamique. Évalué à 1.

    Merci pour la piste, je ne maîtrise pas assez awk, comment puis je passer mon fichier dans ce script ?

    J'ai fait ceci :
    awk -f script-tri.awk < sorted.txt
    awk: script-tri.awk:5: END {for (index in tableau)
    awk: script-tri.awk:5: ^ syntax error
    awk: script-tri.awk:6: print index, tableau[index]
    awk: script-tri.awk:6: ^ syntax error
    awk: script-tri.awk:6: fatal: invalid subscript expression

    Il y a bien un nombre constant de colonne, du coup je pourrais faire le tri sur d'autres champs (nom mentionné ici).

    J'avoue que si cela fonctionne comme ça, ça me parait lisible :)