on 10-20-2008 1:27 PM
Hi Friends,
i am doing file to file scenario.
i am getting file with time stamp as 20081020-062614-501.txt.
But i want Time stamp as yyyymmddThhmmssGMT.txt.
please give me replies.
Thanks
Anil M
You can do it with dynamic configuration option in UDF. Inside UDF, you can get the file name as it is, then change the file name as per your format.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hii
You can solve this by using dynamic configuration.
Please follow the below blog for reference.
Implement the below code to achieve the same.
Create UDF with Date(pre-defined function) as input parameter.
Map the UDF to the root node level of the target message.
//Get Current time
Calendar cal =new GregorianCalendar();
int hour = cal.get(Calendar.HOUR);
if(cal.get(Calendar.AM_PM) != 0)
hour+=12;
int min=cal.get(Calendar.MINUTE);
int sec=cal.get(Calendar.SECOND);
String cur_time=hour""min""sec;
//Get Input Date in the reqd format
String Datetime= Date+""cur_time"GMT";
//I hope file name is constant
String Filename ="ABC";
String extension =".txt"
String dynaname = FilenameDatetimeextension
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create(
http://sap.com/xi/XI/System/File,
FileName);
conf.put(key,dynaname);
return "";
Rgds
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.