Accessing multiple files one by one

Hello,
I have multiple pdf files like lec1.pdf, lec2.pdf etc.
I want to read it’s contents one by one and store it.
I passed intial path to workflows using parameter
Like
Filepath:. C:\data\notes\lec

As its passed as parameter we can access it using Filepath

I want to make this Filepath as
C:\data\notes\lec0.pdf
C:\data\notes\lec1.pdf
C:\data\notes\lec2.pdf

I used the loop and modified javascript and created a variable pathfile in modified javascript which store path like
C:\data\notes\lec0 and so on.
But problem is we can’t provide this variable into
Pdf text step.
Only variable passed to workflow are accessible when we press the CTRL+ SPACE. Fields name doesn’t appear.

Hi,

You can use the ‘Get File Names’ plugin to read all the pdf files from a defined directory (configurable in the plugin), and this plugin would return you with all the details (filename, type,path,size,extension,uri etc) about the files in multiple variables which are directly accessible in the next step of workflow. You can use the ‘filename’ variable to access the complete file path with its name and extension.

To process these files one by one, create a separate workflow (Workflow_2) which would read the contents of one pdf file. Then connect the the ‘Get File Names’ to a ‘Workflow Executor’ (to execute the Workflow_2) in Workflow_1. This way, Workflow_2 will execute every pdf one by one. Please refer below sample screenshots.

image
image

Get File Names configuration to read only pdf files from a directory.

Yes It’ Working . But When I tried to Write Into Single Txt file But it is giving error
After writing the first pdf file into txt file.
See Snapshot

I tried But unable to write and append into single file. After reading and writing the first pdf(lec0.pdf) it provides error In WorkFlow Executor.
Please Check Snapshot and WF.in the attchement.
If I read only then its working Fine (shows correct path in Alert OF Modifed javascript step)
but when I want to write in file it WF executor gives ErrorWF_GetFilesName.psw (16.3 KB) WF_ReadMutiPDF.psw (20.8 KB)

Hi Shubham,

Would you be able to share the error details?

It was shoing just error in workflow executor. Now problem is solved. I reconfigured the workflow executor.