If your Integration Server is not Windows hosted, you can use:
Input Type: Command
Command Type: Command Generating File List
Command: ls -1 <your folder>/*.*
The issue with Windows-based server is that PowerCenter replaces / characters with \ and command that you have to use dir /1 *.* converted into dir \1 *.* and fails.
If both customer_123.csv and customer_234.csv are having similar structure, then you can copy these 2 file names into another file (for ex, customer.csv) and take this customer.csv as source. and use indirect file method in session properties. Follow the same approach for producer_123.csv and producer_234.csv files.
If the source files are not in similar format, then you need to convert both the files into similar format using shell script/batch script and then follow the above approach to load the files.
For example, below is the structure of customer_123.csv file:
CUST_ID CUST_NAME PH_NO 1 A 123 2 B 214 3 C 100
below is the structure of customer_234.csv file:
CUST_ID CUST_NAME PH_NO DOB 1 A 123 8-Aug 2 B 214 8-Jun 3 C 100 8-Apr
In this example, convert customer_123.csv file format to customer_234.csv so that both the files are having similar structure.
Once both the files are in similar structure, you can use indirect file method to process all source files at a time.
Powercenter hosted on a windows machine, currently we do as follows using a command task:
dir <File Location>\*$$Filename*.$$Extension* /B /O:N > <File Location>\LIST_$$Filename.dat
make 'customer' and 'producer' as parameters. and also the extension if needed.
file list is sourced in subsequent session after the command task.
ensure to always delete if exist a file list so that there is no confusion in subsequent loading.
Hope this helps.
can you please supply us with the and example of how to right the:
"dir <File Location>\*$$Filename*.$$Extension* /B /O:N > <File Location>\LIST_$$Filename.dat"
in the command task.
since I'm facing the same problem, where i have a file that is uploaded monthly into a folder, the uploaded folder has the same suffix but different prefix.
as i understood that the command you suggested functioned properly with the same actions.
waiting for your replay as soon as possible.
Hold on, please let's get one step back for an issue which has not yet been clarified.
@Mohan, you mentioned that the source files have different file structures.
Now the big question is whether they shall all be loaded into the same target structure or if each separate source file structure needs to be loaded into its own target DB structure.
Could you please answer this first? The response how to achieve this greatly depends on this question.