on 01-08-2008 6:40 PM
Dear friends,
I've a question about part of a file name in the message mapping.
I receive this file: DESADV02_20071227_160310_2.xml and in my target XML I've the fields date, time and sequence number.
Is there a possibility to map the date in the message name with the date field in the target structure and so on for time and sequence number?
I've seen Michal's blog about how to get the file name in the message mapping but the question is now how to cut the message name and map it to three separate fields (date, time and sequence number)?
[https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2664] [original link is broken] [original link is broken] [original link is broken];
Thank you in advance,
Points will be rewarded,
Kind regards,
Kamran
Write a UDF that does the split.
Its just a question of using java substring functions / split functions.
Regards
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Kamran,
You can follow the below example.
UDF1 -http://www.flickr.com/photo_zoom.gne?id=2180181503&size=o
UDF2- http://www.flickr.com/photo_zoom.gne?id=2180181569&size=o
Mapping -http://www.flickr.com/photo_zoom.gne?id=2180181573&size=o
Results -http://www.flickr.com/photo_zoom.gne?id=2180181575&size=o
The Results are as per your File name in the thread...
raj.
Vakili,
Get the filename using a user defined function as defined by michals blog. Then use this user defined function with the substring functioality and map to your target like:
Source field-->UDF --> Substring(x,y) --> Target field.
I think with this there should not be any issues while mapping the date and time. Also I am expecting the date and time will always be in this format only becaue then only your substring will result the output else it throws mapping exception.
For the sequence number you will hae the problem for writing the substring function. So you may need a user defined function for this also which will pick the value from 'x' location and before '.'
Regards,
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.