cancel
Showing results for 
Search instead for 
Did you mean: 

How to pick the file which is created with current date

Former Member
0 Kudos

Hello All,

I have an FTP server where files are created with current date as PO_CONFIRM_20100701.txt.

Need to pick the file based on current date. How to pick the above file format using file sender adapter. i.e what file pattern can we use so that file will be picked only on today's date

Regards,

Sreenivas.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

HI Sreenivas,

The best possible solution for your issue are:

1. Archive the files, so that the files would be processed as usual.

2. You can add an additional field in the structure and use "Currentdate" function. With reference to this perform Variable substitution.

Former Member
0 Kudos

Hi Sreenivas,

Just a thought on this..

pick the file as soon as it is created using a sender FTP , then place it in another FTP folder with adding the time stamp.

Now you can write a script to find based on the current time or set a filter for the day you want to pick the files.

Regards,

Srinivas

Former Member
0 Kudos

Hi Srinivas,

I feel we dont have a direct option for this. But one work around comes to mind is I assume you are picking up all the files once in a day. You can write a script at OS level and let the script puts todays file in the directory which xi is polling and rest in other directory. This is just a work around. Else you may need to come with your own module.

Regards,

---Satish

Former Member
0 Kudos

Hello Satish,

Thansk for your reply,

Can you let me know how to rename the file in the directory with current date using Script before picking up the file.

Regards,

Sreenivas.

Former Member
0 Kudos

Hi Srinivas,

It depends upon the OS you are using. If unix you can see an example script here:

http://www.computing.net/answers/dos/batch-file-to-rename-files-by-date/5517.html

If windows an example here:

http://en.kioskea.net/forum/affich-87157-finding-and-using-file-date-in-batch-command

You may need to change slightly to fit your exact requirements. But this would make you to start. Else you can also google to get the script. Here is one link:

http://www.google.com/#hl=en&source=hp&q=scripttorenamefileshavingtodaysdate&aq=f&aqi=m1&aql=&oq=&gs_rfai=CRE9SwTMsTNjiDpzGhgTm65iFCwAAAKoEBU_QC2i-&fp=e0fa4b5da4f245a4

Regards,

---Satish