[PERL] Création tableau 2D dynamique indicé
Fermé
trashvip
Messages postés
27
Date d'inscription
samedi 4 septembre 2004
Statut
Membre
Dernière intervention
10 mars 2010
-
15 févr. 2010 à 16:35
trashvip Messages postés 27 Date d'inscription samedi 4 septembre 2004 Statut Membre Dernière intervention 10 mars 2010 - 16 févr. 2010 à 10:00
trashvip Messages postés 27 Date d'inscription samedi 4 septembre 2004 Statut Membre Dernière intervention 10 mars 2010 - 16 févr. 2010 à 10:00
A voir également:
- [PERL] Création tableau 2D dynamique indicé
- Tableau croisé dynamique - Guide
- Tableau word - Guide
- Tableau ascii - Guide
- Creation compte gmail - Guide
- Trier tableau excel - Guide
2 réponses
dubcek
Messages postés
18767
Date d'inscription
lundi 15 janvier 2007
Statut
Contributeur
Dernière intervention
5 mars 2025
5 628
16 févr. 2010 à 07:32
16 févr. 2010 à 07:32
hello
et avec awk ?
et avec awk ?
$ cat a1 H1 5.34 H2 6.56 He4 8.99 He5 7.54 CL7 6.03 Br9 0.04 H2 9.44 H3 5.21 He5 1.11 CL7 4.69 $ awk 'BEGIN{split("A,B,C,D,E,F,G,H",l,",")};NF {x[$1]=x[$1] "\t" $2;z[$1]++};END{a=0;for(n in x){if(z[n]>a)a=z[n]};for(b=1;b<=a+1;b++)printf l[b] "\t";print "";for(b=1;b<=a+1;b++)printf "--------";print ""; for(n in x) print n,x[n]}' a1 A B C ------------------------ He4 8.99 He5 7.54 1.11 Br9 0.04 H1 5.34 H2 6.56 9.44 H3 5.21 CL7 6.03 4.69 $
trashvip
Messages postés
27
Date d'inscription
samedi 4 septembre 2004
Statut
Membre
Dernière intervention
10 mars 2010
5
16 févr. 2010 à 10:00
16 févr. 2010 à 10:00
Merci dubcek.
Comment je fais appel à "awk" dans un script PERL ?
Cdlt
Comment je fais appel à "awk" dans un script PERL ?
Cdlt