cancel
Showing results for 
Search instead for 
Did you mean: 

SFTP Sender Adapter Dynamic Filename

martin_stampfl3
Explorer
0 Kudos

Hello guys,

I have the following Problem with SFTP Sender Adapter:

I want to pull files from an external Server every day the same time. The file has a timestamp in the filename. The Problem is that in this Directory there are files from the last six weeks with timestamp.

How can I select just the most current file ?  Is there a way to use a dynamic Filename?

Thanks a lot already for your help.

Regards Martin

Accepted Solutions (1)

Accepted Solutions (1)

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Martin,

In your SFTP sender channel, use Process Sequence as Descending by Date, in this way, the most current file will get picked up first by the channel.

Can you try this and let me know if you still facing issues.

Regards

Vishnu

martin_stampfl3
Explorer
0 Kudos

Hi Vishnu,

thanks a lot, that hint will help me a lot. But how can I prevent that all the files will be pulled by our Middleware. After sorting the files, I just want the first one to be pulled.

Regards Martin

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Martin,

Under filename parameter in the channel, you can just give some regex(regular expressions) which could pickup the file.

Can you tell me know does all the files are having same filename pattern?

Regards

Vishnu

martin_stampfl3
Explorer
0 Kudos

The filename pattern is always the same, the only difference is the timestamp.

I will have a look on the regex you mentioned thank you

Regards Martin

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Martin,

Just look for any filename pattern that we can give in the channel to pick up the file.

Other way is that you could ask the server contact person, to move the past file to some other directory on the server, if they don't have any business impact/processing on those.

Also, what is the post file processing you are using in the channel.

Regards

Vishnu

Answers (2)

Answers (2)

0 Kudos

Hi Experts,

I have the requirement to do the same in SAP CPI. Can you tell me how to pick the file with current date. I am trying to pick like-> Myfilename_${date:now:yyyy-MM-dd}.csv ; But it is not picking up. Could you please suggest how to do this?

Regards,

Imran

RaghuVamseedhar
Active Contributor
0 Kudos

Martin,

AFAIK, this is not possible. Request source system to place new file in different folder, after PI processes it, it can be archived to old folder (where old files are present).

Please check if below blog is helpful