Search code examples
xmlwindowsbatch-filefile-conversionoraclereports

Automate rename of .rdf files to .XML


I have a requirement to rename .rdf files (report definition file) to .XML and trying to automate this as I'm having hundreds of files. The actual purpose of this exercise is to identify if there are any files which generate an error while converting to .XML and get a list of those files. I'm thinking of writing a .bat file for this.

If anyone has done a similar thing or have an idea kindly share with me.

Thanks in advance.


Solution

  • If you just want to rename RDF files to XML using BAT, you can use the RENAME command. RDF does not need Converting to XML, because it already is XML---just with a different file name.

    from command prompt type RENAME /? to see the options.

    This command renames all the rdf to xml in the current directory:

    RENAME *.rdf *.xml
    

    To output the errors of a BAT file to a LOG file, it has been covered here:

    How to capture stderr on Windows/DOS?