Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2263 connectés 

 


Dernière réponse
Sujet : Sort
jlighty Quelques indices dans le man de sort :

Citation :

-n, --numeric-sort
              comparer selon la valeur numérique de la chaîne
 


et  
tiré d'un man sur google http://developer.apple.com/documen [...] ort.1.html

Citation :


+POS1 [-POS2]
              Specify  a  field within each line to use as a sorting key.  The
              field consists of the portion of the line starting at  POS1  and
              up  to  (but  not  including) POS2 (or to the end of the line if
              POS2 is not given).  The fields and character positions are num-numbered
              bered starting with 0.


 


Votre réponse
Nom d'utilisateur    Pour poster, vous devez être inscrit sur ce forum .... si ce n'est pas le cas, cliquez ici !
Le ton de votre message                        
                       
Votre réponse


[b][i][u][strike][spoiler][fixed][cpp][url][email][img][*]   
 
   [quote]
 

Options

 
Vous avez perdu votre mot de passe ?


Vue Rapide de la discussion
jlighty Quelques indices dans le man de sort :

Citation :

-n, --numeric-sort
              comparer selon la valeur numérique de la chaîne
 


et  
tiré d'un man sur google http://developer.apple.com/documen [...] ort.1.html

Citation :


+POS1 [-POS2]
              Specify  a  field within each line to use as a sorting key.  The
              field consists of the portion of the line starting at  POS1  and
              up  to  (but  not  including) POS2 (or to the end of the line if
              POS2 is not given).  The fields and character positions are num-numbered
              bered starting with 0.


 

vincent0 Bonjour,
 
J'ai ceci dans un fichier:
 

13  fgdhgfh     125     rgrre
11  uou         12500   rtrt
113 fiuu        7890    ghsjk
0   frey        78900   ytytr
123 ery         12      fftt


Comment trier ce fichier par ordre croissant en fonction du dernier chiffre de la ligne et donc obtenir ceci:
 

123 ery         12      fftt
13  fgdhgfh     125     rgrre
113 fiuu        7890    ghsjk
11  uou         12500   rtrt
0   frey        78900   ytytr


Avec "sort" mais comment ?
 
Merci d'avance...


Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)