cancel
Showing results for 
Search instead for 
Did you mean: 

Sender File Adapter- Incrementing the counter in file name

Former Member
0 Kudos

Hello,

We have a requirement to read a different file name with every read. Every subsequent file would have a numeric counter updated when we receive it, we need to read that file as the directory would hold the previous files as well.

File structure :- EP<counter>.txt ; so first file would be EP001.txt, next one would be EP002.txt.

How could i do this in Sender file adapter, as there is no variable substitution available like receiver file adapter.

I cannot use wild card characters as the directory would contain previous files as well and we ned to pick the latest file.

Regards

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

How does 'setting to read only ' guarranty that latest file would be pciked .

e.g. we have EP001.txt EP002.txt and EP003.txt, if I use EP*.txt, that would process all three, i am i wrong here???

former_member187339
Active Contributor
0 Kudos

Hi,

It will not process the latest file, it will process all non processed files.. the one that is processed will be made read-only and hence will not be processed again...

if you are looking for processing in order !! then you need to use some batch program which will move the files in some other folder ( a folder where PI is polling) and once the file is picked by PI, it will put it back to the original folder.

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

I guess i won't be able to use this parameter as i am using FTP.

The idea was to work out a way where i don't have to move the files in the directory but could always increment the counter in file name before reading the file. Is this possible?

Regards

former_member187339
Active Contributor
0 Kudos

Hello...

I guess no but would love to hear if you have achieved any workaround ... What about adapter modules !!! (i will not prefer this method though)

For NFS there would have been some alternatives but not for FTP.

Regards

Suraj

former_member187339
Active Contributor
0 Kudos

Hi,

>>How could i do this in Sender file adapter, as there is no variable substitution available like receiver file adapter.

Yes true this is not available in sender channel

>>I cannot use wild card characters as the directory would contain previous files as well and we ned to pick the latest file.

You can use EP* as the filename and use processing mode as Set to Read-Only

Regards

Suraj