Retourner au contenu associé (entrée de forum : Récupérer des infos d'un fichier : parser.)
Posté par totof2000 le 09 mai 2011 à 21:28. En réponse au message Récupérer des infos d'un fichier : parser.. Évalué à 1.
Syntaxe wiki dee Mxxxx
awk -F"," '{for (i=1;i<=NF;i++) { #print("i: " i " Value : " $i) split($i,tab,":") #print "Key: " tab[1]
value=substr($i,length(tab[1])+2) #print ("Value: " value) hash[tab[1]]=value
} } END { for (key in hash) { print "Key: " key ", value : " hash[key] } } ' toto.txt
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
[^] # Re: awk est ton ami
Posté par totof2000 . En réponse au message Récupérer des infos d'un fichier : parser.. Évalué à 1.
Syntaxe wiki dee Mxxxx
awk -F"," '{for (i=1;i<=NF;i++) {
#print("i: " i " Value : " $i)
split($i,tab,":")
#print "Key: " tab[1]
}
}
END {
for (key in hash) {
print "Key: " key ", value : " hash[key]
}
} ' toto.txt