Txt file reader

I am trying to update someonelse code, the attached code reads from a unicode txt files and compares a string of “Department_Name|Division_Name|Position_Name|Job_Name” with a db field called “ident_org” in org tbl. Since it is a bad design, I need the code to check a combination of "“Department_Code|Division_Name|Job_Code” against db and get the value of uid_org (unique key). Then if key exists then update that specific row(s) else insert the combination of “Department_Name|Division_Name|Position_Name|Job_Name” into db.

I need help with this…

Sample: txt file rows are at below.
TYPE ID Company_Name Company_Code Dept_Name Dept_Code Division_Name Division_Code Position_Name Position_Code Job_Name Job_Code Service_Name Service_Code System_Name System_Type Application_Name ROLE_ID Role_Name Role_Values Status IDM_Managed Approval_Status Create_Date Created_By Update_Date Update_By Approved_By Approval_Date Version

I Genel Müdürlük Teftiş 1 G011A100 GENEL MÜDÜRLÜK 1 Yetkili Müfettiş Yardımcısı 162 Yetkili Müfettiş Yardımcısı 162-YEMUF01 ADS Microsoft ADS ADS CifsTeftisAviWR CifsTeftisAviWR 1 1
I Genel Müdürlük Teftiş 1 G011A100 GENEL MÜDÜRLÜK 1 Yetkili Müfettiş Yardımcısı 162 Yetkili Müfettiş Yardımcısı 162-YEMUF01 ADS Microsoft ADS ADS CifsTeftiskrl2005WR CifsTeftiskrl2005WR 1 1