Hi All,
I want to find (1) number of occurs (2) If number of occurs is more than 2 then I need the "path" values from list as this samples.
I used the Word_occurs() for finding the Number of Records.
I am trying to append the invoices by same job name,
as like pdf_append(Invoices_1329.pdf , Invoices_1351.pdf, one_pdf_file ).
I have trouble to find the "Path (example; Invoices_1329.pdf and Invoices_1351.pdf)" from my list.
I also tried with an Array but I have no idea what to do next.
I want to find (1) number of occurs (2) If number of occurs is more than 2 then I need the "path" values from list as this samples.
I used the Word_occurs() for finding the Number of Records.
I am trying to append the invoices by same job name,
as like pdf_append(Invoices_1329.pdf , Invoices_1351.pdf, one_pdf_file ).
I have trouble to find the "Path (example; Invoices_1329.pdf and Invoices_1351.pdf)" from my list.
Code:
'The folder List files, after created the PDF files vfolder=<<%list% Y:\shareData\Invoices\Group by Job\UMMC Shock Trauma\Invoices_1329.pdf Y:\shareData\Invoices\Group by Job\UMMC Shock Trauma\Invoices_1351.pdf Y:\shareData\Invoices\Group by Job\UM Bookstore\Invoices_1278.pdf Y:\shareData\Invoices\Group by Job\UM Bookstore\Invoices_1800.pdf Y:\shareData\Invoices\Group by Job\UMB Terrace\Invoices_1093.pdf Y:\shareData\Invoices\Group by Job\NASM Renovations PH 2\Invoices_1333.pdf %list% vfolder = alltrim(vfolder) nFolder = *count(vFolder) vTrimFolder="" for each foo in vfolder 'get the job name only and subtract with job name vTrimfolder = vtrimfolder + alltrim(word(foo.value,5,chr(92)))+crlf() next vPostfolder = *remove_duplicates(alltrim(vTrimFolder)) 'How to find the number of occur from the list? nLine=0 for each x in vPostFolder nFound = word_occurs(alltrim(vTrimFolder),alltrim(x.value),crlf()) 'vTrimFolder - work If nFound = 1 ' 'It works fine when nFound = 1 case 'show the pdf file nLine = word_number_get(vTrimFolder,alltrim(x.value),crlf()) 'msgbox("Numb of found ","Found "+str(nfound)+" line as "+str(nLine) ) vViewFilePath = alltrim(word(vFolder,nLine,crlf())) ' if file.exists(vViewFilePath) then ' sys_open(vViewFilePath) ' else ' ui_msg_box("Error Opening File","File "+vViewFilePath + "does not exist.",ui_stop_symbol) ' end if else if nFound > 1 'How can I get the nTh Line number for i = 1 to nfound [COLOR="#FF0000"][B]nLine = word_number_get(vTrimFolder,alltrim(x.value),crlf()) 'I can find only one[/B][/COLOR] msgbox("Numb of found 2","Found "+str(nfound)+" line as "+str(nLine) ) vViewFilePath = alltrim(word(vFolder,nLine,crlf())) next i 'Append here 'pdf_append(vPage1,vPage2,vSavePdffile) end if
Code:
vfolder = alltrim(vfolder) 'create an array nCount = *count(vFolder) dim a_folderList[nCount] as p 're-arrange the list, path + jobname+inv_name cWord ="" for i = 1 to nCount cWord = word(vFolder,i,crlf()) a_folderList[i].path = word(cWord,1,chr(92))+chr(92)+word(cWord,2,chr(92))+chr(92)+word(cWord,3,chr(92))+chr(92)+word(cWord,4,chr(92))+chr(92) a_folderList[i].jobnm = word(cWord,5,chr(92))+chr(92) a_folderList[i].invNm = word(cWord,6,chr(92)) next showvar(a_folderList[6].path,"test array list") [COLOR="#FF0000"][B][COLOR="#FF0000"][B]'How to find the Number of occurs with this array?[/B][/COLOR][/B][/COLOR]
Comment