• [^] # Re: .

    Posté par . En réponse au message Remplacer des cellules. Évalué à 2.

    EDIT : j'ai parlé trop vite...et en même temps la question n'était pas posé correctement.

    Dans le cas où mon fichier ne serait pas trié ou lorsque j'ai une classe qui a disparu en 2016 par rapport à 2015, cela ne marche pas.
    identifiants2015.csv
    $cat identifiants2015.csv
    CLASSE,NOM,PRENOM,IDENTIFIANT,M.de P.
    c303,X,john,john.x,6821ff
    c601,A,antoine,antoine.a,4f56yg
    c504,B,micheline,micheline.b,654pgh

    identifiants2016.csv
    CLASSE,NOM,PRENOM,LOGIN,MOT DE PASSE
    c601,Z,bob,bob.z,t954fd
    c502,A,antoine,antoine.a,(déjà attribué)
    c404,B,micheline,micheline.b,(déjà attribué)

    $grep -v '(déjà attribué)' class2016.csv | cat - <(join -t',' <(tail -n +2 class2016.csv | sort) <(tail -n +2 Id2015.csv | sort) -j 2 -o 1.1,1.2,1.3,1.4,2.5) >logins_maj2016.csv

    join: /dev/fd/62:2 : n'est pas trié : c504,B,micheline,micheline.b,654pgh