cancel
Showing results for 
Search instead for 
Did you mean: 

Script for picking multiple files from multiple folders dynamically using single file CC

former_member190358
Participant
0 Kudos

Hello all,

I have a requirement where i need to pick multiple files from multiple folders and these folders are also not constant but dynamic at run time.

Viz. There is no fixed rule for these folder names . But the starting of the folder is static.

Lets say there are 5 folders from where i have to pick up the file using one communication channel.

The path could be "

Scan/PNC1-BR-20131018-001

Scan/PNC1-BR-20131018-002

Scan/PNC1-BR-20131018-003

Scan/PNC1-BR-20131018-004

Scan/PNC1-BR-20131018-005

Please note that these folder name always change , so i cannot have multiple sender file communication channel.

However, i think a script can achieve this . I can call this script in the RUN OS command before processing field in the file adapter.  Reference filename in the file adapter as PNC1*.

But not sure what the code would be .

Can someone help me .

Regards,

Ravi

Accepted Solutions (1)

Accepted Solutions (1)

iaki_vila
Active Contributor
0 Kudos

Hi Ravi,

I think you also can achieve this issue writing an adapter module or doing a java mapping. With a shell script you could use  the commands 'find' and 'cp' like the next example ttp://www.cyberciti.biz/tips/howto-linux-unix-find-move-all-mp3-file.html

Regards.

Answers (1)

Answers (1)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Ravi,

                  You need to explain the logic on how the script will determine which folder to read from?

Do you have any logic to determine the folder name on a particular time? You need to include that in the script.

Regards

Anupam