Bonjour !
Comment trier avec sort le fichier suivant :
aabc3@xyz,info.1,info_2
aabc2@xyz,info.1,info_2
aabc5@xyz,info.1,info_2
a.abc1@xyz,info.1,info_2
a.abc4@xyz,info.1,info_2
a_abc6@xyz,info.1,info_2
a_abc0@xyz,info.1,info_2
pour obtenir un résultat "naturel", c'est à dire avec prise en compte des . et des _ contenus dans les champs de tri.
J'ai essayé :
sort -t, -k1,1 email.txt
mais j'ai obtenu :
a_abc0@xyz,info.1,info_2
a.abc1@xyz,info.1,info_2
aabc2@xyz,info.1,info_2
aabc3@xyz,info.1,info_2
a.abc4@xyz,info.1,info_2
aabc5@xyz,info.1,info_2
a_abc6@xyz,info.1,info_2
alors que je m'attends à avoir un bloc avec toutes les lignes commençant par a.bc, un bloc avec toutes les lignes commençant par a_bc, un bloc avec toutes les lignes commençant par abc avec bien sûr les lignes triées à l'intérieur de chaque bloc.
Merci,
JP
Poste le Wednesday 19 October 2011 18:15:50