on 07-01-2013 12:28 PM
Hello All,
I have a requirement where the target output file name needs to be populated as below in my Receiver SFTP channel.
Channel is creating as : CTACT_CG_.<YYYYMMDD-HHMMSS>.TXT
Client expecting as : CT_CG.TXT.<YYYYMMDD-HHMMSS>
I want to achieve this by executing a OS command in the channel.
Can anyone help me in building a OS command instead of going for Shell script
Regards,
Moorthy
Hi Naresh,
You should tell us what OS have you installade in the SFTP location.
In Linux:
http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html
http://heatware.net/linux-unix/change-file-extensions-directory-linux/
In Windows:
http://www.computerhope.com/renamehl.htm
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Naresh,
If your scenario has mapping in it please use ASMA within UDF as shown below
public String putFileName(String Number,Container container){
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("'http://advantco.com/xi/XI/SFTP","FileName");
String s="CT_CG.TXT"+""+java.text.SimpleDateFormat("<yyyyMMdd-HHmmss>").format(new java.util.Date());
conf.put(key, s);
return " ";
}
Map this UDF to root element or any dummy field in target XML.
In Receiver CC you need to set these
1. Receiver Comm Channel has ASMA , file name and "fail if ASMA missing" ticked.
2. in receiver communication channel -> File access parameters-> File name scheme -
> put any value say "*". This step is not compulsory.
3. In target directory of receiver CC put the name of the directory where you need the file to be formed.
Regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.