Coding task

i have this code , it reads a .txt file i want to use the data i retrieve from that file to do some queries. So you have to fill the blank with these conditions :

for each row of the text file (each emplid which is the first variable ) do the following :
-Find all applications for the EMPLID where Institution = UOTTA in the table PS_ADM_APPL_RCR_CA (emplid and institution are fields in that table ):
then for each row of the previous query (EACH application ) do the following :
if recruitment_cat in the table PS_ADM_APPL_RCR_CA is empty for that emplid , select the correctponding field descr in the table PS_RECRUIT_CAT_TBL based on &recruitment_cat (the one we took from the file)

If there is more than one application that meets the criteria above insert the recruiting tag for each qualifying application.

If there IS another recruiting tag attached to that application, insert a second row.

If the SAME recruiting tag exists for that application, update it

If there is no application attached to the EmplID for a current or future term for UOTTA, skip that row and move on to the next

The code :
import UO_FRAMEWORK:FileUtilities:FileParser;

Local string &filePrefix = “ADM_INT266_Recruiting_Categories”;
Local string &folderPath = GetEnv(“PS_CUST_HOME”) | GetURL(URL.UO_INT266_INBOUND);

Local boolean &fileFound = False;
Local string &fileName;

While Not &fileFound
&fileName = &filePrefix | “.txt”;
Local JavaObject &fileObj = CreateJavaObject(“java.io.File”, &folderPath | &fileName);
If &fileObj.exists() Then
&fileFound = True;
Else
MessageBox(0, “”, 0, 0, “No matching file found with prefix %1”, &filePrefix);
Break;
End-If;
End-While;

If &fileFound Then
Local integer &lineNbr = 1;
Local integer &count = 0;

Local string &emplid, &last_name, &first_name, &birthdate, &recruitment_talisma, &date_field;

Local UO_FRAMEWORK:FileUtilities:FileParser &fp = create UO_FRAMEWORK:FileUtilities:FileParser(“|”, “”);
Local string &line = “”;

Local File &f = GetFile(&folderPath | &fileName, “R”, “UTF8”, %FilePath_Absolute);

While &f.ReadLine(&line)
If &lineNbr > 1 Then
Local array of string &ar = &fp.ParseRow(&line);

&emplid = &ar [1];
&last_name = &ar [2];
&first_name = &ar [3];
&birthdate = &ar [4];
&recruitment_talisma = &ar [5];
&date_field = &ar [6];

REMAINING CODE HERE

End-If;

&lineNbr = &lineNbr + 1;
End-While;

&f.Close();

If &count > 0 Then
CommitWork();
End-If;
End-If;