Ajout de colonne dans un fichier csv (avec recherche dans une variable)

From Tuxunix
Revision as of 12:29, 11 March 2015 by Admin (Talk | contribs) (Created page with "<syntaxhighlight lang="bash"> for i in $(cat passwords.csv); do if $(grep -q "mgmnt" <<< "${i}"); then echo ${i} | awk -F "," '{print $1","$2",""DefaultMdp"","$4","...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
 for i in $(cat passwords.csv); do 
   if $(grep -q "mgmnt" <<< "${i}"); then
     echo ${i} | awk -F "," '{print $1","$2",""DefaultMdp"","$4","$5","$6","$7","$8","$9","$10}' >> newPassword.csv;
   else
     continue;
   fi 
 done