0

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.

DaFi4
  • 1,364
  • 9
  • 21
CAD
  • 4,112
  • 6
  • 29
  • 47

1 Answers1

1

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?

Community
  • 1
  • 1
DaFi4
  • 1,364
  • 9
  • 21
  • Thanks for the answer. The actual reason behind is, we need all RDF files to be shown with the extension .xml and then only one of our another tool can read those files for a quality check (This tool just extracts the SQL from the XML file) – CAD Jul 18 '16 at 10:22
  • it sounds like you want to RENAME so I change my answer. Convert generally means something different. RDF is already XML inside, so it does not need to be Converted. – DaFi4 Jul 18 '16 at 13:28