on 04-16-2015 6:11 PM
Hello Experts,
I am working on file(NFA) to SFTP scenario with out mapping . I am getting file from AL11 folder with the name of XXXX_20150404033752.csv and receiver side (in PI) im getting file name as XXXX_20150404-040420-142.csv. But it should be 20150404033752_001_csv with out "-" and it should be sequence of 001, 002,... .
For example, if the files were given a name corresponding to a time stamp, the first file might be called 20150404040420_001. The second would be called 20150404040420_002. These files were both named after the date and time stamp April 04, 2015 at 04:05:02.
Without doing any mapping can I do this?
Thanks in advance,
Reddy.
I have one more doubt
I am sending .csv file to sftp server and after a file is successfully retrieved, it should be renamed to replace the “.csv” file extension with a “.got” file extension.
Is this posibble to do in PI?
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>>>I am working on file(NFA) to SFTP scenario with out mapping . I am getting file from AL11 folder with the name of XXXX_20150404033752.csv and receiver side (in PI) im getting file name as XXXX_20150404-040420-142.csv
If you want to append a counter to the source filename
>>For example, if the files were given a name corresponding to a time stamp, the first file might be called 20150404040420_001. The second would be called 20150404040420_002.
Do you expect two files with the same timestamp? There should be some difference in the filename right as you can't have 2 files with samename.
If appending the counter doesn't work, either you have to go for a java mapping/AM to set the file-name as you want.
Dynamic file name for pass-through scenario - Process Integration - SCN Wiki
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hareesh,
Thanks for the reply .
I am using SFTP adapter in receiver channel and i ddnt find any file construction mode option in receiver channel. Is there any other option to do this?
>>>>>Do you expect two files with the same timestamp? There should be some difference in the filename right as you can't have 2 files with samename.
sorry, two files with different timestamp.
Thanks
As you need to counter for every file, you need to have mechanism to generate the sequence number
You can go for RFC/DB lookup for the same.
Refer to below blog -
Once you have that, everything else it straight forward.
-> enable the checkbox for "filename" in your sender file channel
-> in your mapping, add a UDF to read the filename and append the counter using a UDF. You can search for "dynamic filename UDF" in in SCN. You can find lot of blogs. <<if you can't go for graphical mapping, then make a RFC call in your java mapping)
reference : User-defined Mapping Function for RFC Lookup - Code Gallery - SCN Wiki
-> enable the checkbox for "filename" receiver channel too.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.