cancel
Showing results for 
Search instead for 
Did you mean: 

Change File Extension

Former Member
0 Kudos

Hi Experts

I am pulling a .txt file from a location and dropping it to another location using file adapter. Is there a way I can change the file extension .txt to .xml when I drop the file?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hector, I am transferring a file ,say Test.txt from one location and getting the file in the desired XML format at the other location as Test Timestamp.txt. But I want that file as Test Timestamp.xml.

Thanks

Skaria

Former Member
0 Kudos

Hi Skaria -

Make sure you're not using the Adapter Specific Message Attributes (ASMA) option on your receiver file channel. If you need to use it for something other than the file name attribute, you can still select the "Use Adapter Specific Message Attributes", but then unselect "File Name".

However, if you need use the same file name as is picked up, but just with a different extension, you have to change ASMA filename in the message header (e.g. in a mapping).

Regards,

Jin

Answers (5)

Answers (5)

Former Member
0 Kudos

Thank You very Much Jin, It worked.

Hector Thanks for your contributions as well.

Skaria

Former Member
0 Kudos

So, symply, put in the parameter FILE NAME, the file name with the extention .xml, something like this:

Target directory: d:/usr/sap/trans/tmp/

File Name scheme: Test.xml

File Construction mode: ‘Add time stamp’

This has to work

Hector

Former Member
0 Kudos

Skaria...

When the scenario is running its throw you an error or simply doesn't create the file?

Hector

Former Member
0 Kudos

Hi Hector,

I tried that, but it did'nt work. Yes the file is having XML structure

Thanks

Skaria

Former Member
0 Kudos

Hi Skaria

Yes, you can, just you have to do is in the output directory put the extention .xml, but the output file has to have a XML structure.

I hope that aid you

Hector