Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

how to read multiple sub folders files thru listFile processor ?

avatar
Explorer

Hi Team,

I have folders like below. i want to read files from inbox folder only for all customers (customer_A, customer_B, customer_C).

/homepath/customer_A/inbox/

/homepath/customer_A/outbox/

/homepath/customer_A/sentbox/

/homepath/customer_A/recievebox/

/homepath/customer_B/inbox/

/homepath/customer_B/outbox/

/homepath/customer_B/sentbox/

/homepath/customer_B/recievebox/

/homepath/customer_C/inbox/

/homepath/customer_C/outbox/

/homepath/customer_C/sentbox/

/homepath/customer_C/recievebox/

in ListFile processor, can you suggest me how to give multiple customer names and inbox folder name.

if i give /homepath/ in directory property, listFile is listing the files of other folders outbox, sentbox..

Can any one suggest me how to use expression language to give multiple customername and inbox folder in ListFile directory property.

Note: there is a chance, in future there could be more customer folders we need to read.

Thanks,

Rangareddy Y

8 REPLIES 8

avatar
Super Collaborator

you can use a regular expression for the filename in the listFile processor. So something like "/homepath/customer_[ABC]/*" should be possible. But you will need to have a pattern to determine customer dirs from other dirs that will match potential additional customers dirs as well.

avatar
Explorer

Thanks for the reply.

sorry, given wrong names..we have customer names like below

/homepath/ranga/inbox/
/homepath/reddy/inbox/

/homepath/yenimi/inbox/

/homepath/test1/inbox/

.

.

.

like we have 100+ different folders are there....

there is no common name pattern in customer name...in this case..how to give..
like above, we have 100+ customer folders are there...we are planning to write multiple listFile processor to read files based on income files. In this case, how can we give (a,b,c,d,e,f ) customers in one listFile processor and (g,h,i,j,k,l) in another listFile processor...


Thanks,
Rangareddy Y


avatar
Super Collaborator

yes you can process with two listFiles processors. So in /homepath all subdirs belong to a customer? Or will there be subdirs not related to customers that you don't want to scan? And for all customers subdirs you want to scan/process the inbox subdir for new files?
Assuming you have only customer dirs your dir pattern can be:
/homedir/*/inbox

avatar
Explorer

if i give /homedir/*/inbox/ in listFile processor, processor is showing invalid and giving error "directory does not exist".

avatar
Super Collaborator

try /homedir/\*/inbox/\* as the filename or maybe better /homedir as the directory and \*/inbox/\* as the filename

avatar
Explorer

no luck, same error..if i give full path without asterisk, it is accepting.

avatar
Explorer

Thanks for the reply @Harald Berghoff
can you suggest me how to give the input directory path in listFile processor for below scenario.
lets assume these folders exists in local system.

/homepath/ranga/inbox/

/homepath/krishna/inbox/

/homepath/kaja/inbox/

/homepath/jilebhi/inbox/

/homepath/laddu/inbox/

/homepath/bundhi/inbox/


like 100+ folders are there...i have used multiple listFile processor based on folder size files.

lets assume, 3 listFile processors i used in my flow and want to configure perticular folders in listFile processor.

in first listFile processor, i want to point (ranga, krishna) folder paths,
in second listFile processor, i want to point (kaja, jilebhi) folder paths,

in third listFile processor, i want to point (laddu, bundhi) folder paths,

can you please suggest me how to achieve above case...

Thanks,

Rangareddy Y

avatar
Explorer
@Harald Berghoff

inbox does not have any sub folders..we have to scan inbox folder files only.

in below case, how to write logic for input directory ? lets assume these folders exists in local system.

/homepath/ranga/inbox/

/homepath/krishna/inbox/

/homepath/kaja/inbox/

/homepath/jilebhi/inbox/

/homepath/laddu/inbox/

/homepath/bundhi/inbox/


like 100+ folders are there...i have used multiple listFile processor based on folder size files.

lets assume, 3 listFile processors i used in my flow and want to configure perticular folders in listFile processor.

in first listFile processor, i want to point (ranga, krishna) folder paths,
in second listFile processor, i want to point (kaja, jilebhi) folder paths,

in third listFile processor, i want to point (laddu, bundhi) folder paths,

can you please suggest me how to achieve above case...

Thanks,

Rangareddy Y