Matching to fields then replace once field if differnt
This might sound strange but can anybody thing of a way to script this. I have a copy of MDL_user from my moodle database which has all my lea's usernames in - half of mine our different to them and I am hoping to move this in house. Basicly I want the script to search csv1 and read the first name, surname fields and samaccountname - then check csv2 and if the first name and surname match replace the username.
Currently I have 2 spreadsheet one with the headings givenname,sn and samaccountname
id,auth,confirmed,policyagreed,deleted,mnethostid, username,password,idnumber,firstname,lastname,emai l,emailstop,icq,skype,yahoo,aim,msn,phone1,phone2, institution,department,address,city,country,lang,t heme,timezone,firstaccess,lastaccess,lastlogin,cur rentlogin,lastip,secret,picture,url,description,ma ilformat,maildigest,maildisplay,htmleditor,ajax,au tosubscribe,trackforums,timemodified,trustbitmask, imagealt,screenreader