Source file name: customers.dat Customer_Id Location Target: Customers_TBL Customer_Id Location FileName
The steps involved are:
The loading of the filename works for both Direct and Indirect Source filetype. After running the workflow, the data and the filename will be loaded in to the target. The important point to note is the complete path of the file will be loaded into the target. This means that the directory path and the filename will be loaded(example: /informatica/9.1/SrcFiles/Customers.dat).
If you don’t want the directory path and just want the filename to be loaded in to the target, then follow the below steps:
REVERSE ( SUBSTR ( REVERSE(CurrentlyProcessedFileName), 1, INSTR(REVERSE(CurrentlyProcessedFileName), '/') - 1 ) )