Skip to Content
author's profile photo Former Member
Former Member

Rename file in sender FTP

Hi,

I have a file to file scenario which is picking files from different path of a FTP.

My requirement is to rename the file in the corresponding folder of the FTP .

e.g :

PI is picking files from the following paths of FTP

/ABC/TEST/TR_abc.xml

/DEF/TEST/SA_qwe.xml

after picking files from this path it should be like that -

/ABC/TEST/Processed_TR_abc.xml

/DEF/TEST/Processed_SA_qwe.xml

Is there any technique to do this without writing a shell script.

Thanks,

Apu

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Sep 05, 2013 at 03:21 PM

    Hello Apu,

    For picking files from two different locations , use file masking in sender FTP communication channel.

    Regarding renaming file as /ABC/TEST/Processed_TR_abc.xml and /DEF/TEST/Processed_SA_qwe.xml , use dynamic configuration(UDF in Message mapping) or use Adapter module.Dynamic configuration (UDF in message mapping ) is the easiest way to achieve this .

    Regards

    Hari.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 05, 2013 at 07:09 PM

    hi Apu,

    There is no standard way to rename the file if you are looking at something available in file adapter.

    you can try Run OS command after message processing and rename the file there.

    cheers,

    Ambrish

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 05, 2013 at 08:08 PM

    Hi Apu,

    If your requirement is just to know that the file was already processed, you can set the archive option in sender channel, the archived file name will have a time stamp added along with original file name.

    Regards,

    Zameer

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Dear Zameer,

      I can use the archive option and provide there the path where from I am picking the file and it will rename it with the time stamp.

      But the problem is that I am picking file from different path of a ftp using a single communication channel .

      If I archive I will be allowed to provide a common path for the different files of different locations , but my requirement is to rename the file in different locations.

      Thanks,

      Apu

  • author's profile photo Former Member
    Former Member
    Posted on Sep 06, 2013 at 10:11 AM

    Hi Apu,

    I have a file to file scenario which is picking files from different path of a FTP.

    You can easily pick multiple files from different locations using 'Advance Selection for Source file' option in the sender File adapter.

    My requirement is to rename the file in the corresponding folder of the FTP

    There are numerous ways to rename a file.

    1) Activate the ASMA (Adapter Specific message attribute) in your sender file adapter and check the File Name option. You will get the File name in the msg payload.

    Now use Dynamic Configuration (using UDF or Module) to change the name of the file at runtime as per your requirement. You can find numerous blogs on Dynamic Configuration 😊

    2) You can use OS command in the Receiver File adapter to change the filename. 😊

    Thanks

    Partha

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.