Search code examples
informaticainformatica-powerexchange

how to load multiple files into one file using informatica


I am new to informatics, I have created a mapping that using expression and sorter transformation to load multiple files into one single file which have 2 columns

1 data
2 seq number

All 10 files have random sequence numbers Like example: file1

erfef 3
abcdn 1

file 2

wewewr 4
wderfv 5

and so on till 10 files.

Expression transformation code is :

INTEGER(LTRIM(RTRIM(seq_num)),TRUE)

what I want is to load the file into one big file and sort it according to the seq number.

Got data in output file but number with incorrect seq number.

How to get data in the final table with a correct sequence number.

doing exactly what is mention in the below solution but still getting wrong output. getting output like:

erfef 3
abcdn 1                                                                                                                                            
wewewr 4
wderfv 5

where as it should be like below:

                                                                       where as it should be like 

abcdn 1                                                                                                                                
erfef  3                                                                                                                          
wewewr 4  
wderfv 5

Thanks in Advance !!!


Solution

  • Use indirect file load using a list of files to load all files together. Then use sorter on col2 to order the data. Finally use a target file to store data.

    Whole mapping should be like this -

    SQ --> EXP--> SRT(key = col2) --> Target
    

    Few things to note -

    • In the session, use indirect file and use a list file name - mention filelist1.txt
    • Use ls -1 file* >filelist1.txt in pre session command task to create a file list with all required files.
    • Expression transformation- convert the col2 to INTEGER if its coming up as string in SQ.
    • Sorter transformation- use col2 as key column.