watchDirectory Help > Task History > Export to XML
Export to XML
Import into Microsoft® Access®
- Create a new Access Database
- Choose File -> Get External Data -> Import
- In the dialog select XML for "Files of type"
- Select an XML file exported by the History program.
If you want to process the data of the history program in other programs, such as Microsoft® Excel® or Access®, you can export all data to XML files. Inside the Task History viewer press CTRL+X or choose the File -> Export menu option.
Settings for XML Export
Export to fileEnter the name of an XML file. If the file already exists, it will be overwritten.
Export only the selected taskSelect this option to export the currently selected task inside the Task History viewer. If you deselect this option, all tasks are exported.
Export all runsIf you want to export all runs of the task(s) leave this option selected. When you deselect this option only the most recent run is exported.
Export messagesSelect this option to export the messages that are available in the history database. You can limit the type of messages by deselecting some of the debug, info, warn and error checkboxes.
Export each task to its own fileSelect this option to create an XML file for each task that is exported. If you enter D:\Data\watchdirectory.xml inside the Export to file box, the XML for task HELLO is written to D:\Data\watchdirectory_HELLO.xml.
The history program also writes a file called wdexport.xsd to the directory where the exports are created. This is the XML Schema for the XML files.
Export using the command line
If you regularly export the task history, or want to automate it by using a batch script, you can use command line parameters. This also gives you an easy way to automatically run an XSL transformation on the generated XML.
Supported command line switches
Quote long filenamesOn a command prompt, when you enter a filename containing spaces, be sure to surround the name with "quotes"!
Wrong: C:\My Data\Hello World.xml
Correct: "C:\My Data\Hello World.xml"
This is a required switch. If you do not use this switch, the Task History program will start in normal mode, showing its window. It must also
be the very first switch on the command line. The other switches can be in any order.
-file filenameToExportTo: This is a required switch, and tells the history program to what file it should write the export. If the file already exists it is overwritten.
-task taskname: This is a required switch, and tells the history program which task you want to export. The command line only supports one task at a time.
-allruns: This optional switch tells the history program to export all runs of the task. If you omit this switch, only the most recent run will be exported.
-messages diwe: This optional switch tells the history program to export the messages of the task to the XML file. You can limit the number and kind of messages that are exported with an extra argument. This argument consists of the following letters:
- d - export Debug messages
- i - export Informational messages
- w - export Warning messages
- e - export Error messages
Example: export the current run, all messages, of task HELLO
"C:\Program Files\watchDirectory\History.exe" -exporthistory -task HELLO -messages diwe -file D:\Export\Hello.xml
Example: export all runs, but only warning and error messages, of task HELLO
"C:\Program Files\watchDirectory\History.exe" -exporthistory -task HELLO -allruns -messages we -file D:\Export\Hello.xml