MarcEdit: Validating data from the command-line
One of the tools that MarcEdit has built-in into it is a light-weight validator. For a long time, there has been an Easter Egg of sorts that allowed folks to access the validator via the command-line, if they knew the syntax. It was something that I primarily used for my own purposes and hadn’t expected anyone else to be interested in it. But do to a request, I’ve formalized the syntax and will expose this functionality on the next update. In MarcEdit 5.9, you will be able to access the Validator via the command-line using the following syntax:
C:\Users\reeset>%MARCEDIT%\cmarcedit -validate -s c:\users\reeset\desktop\output.mrk –d c:\users\reeset\desktop\report.txt -rules %APPDATA%\marcedit\configs\marcrules.txt
The important elements of the argument are as following:
- %MARCEDIT% – this is an environmental variable that I’ve configured on my own machine. It stands in for the path to the cmarcedit program. I highly recommend creating your own local environmental variable if you will be using the command-line tool
- -validate: This is the switch that tells the command-line tool that you will be invoking the validator.
- -s: File to validate. Can be either in MARC or mnemonic formats.
- -d: Path to where you want the Validation report to be saved.
- -rules: Path to the Rules file. The default rules file is found in the user apps directory. You can use %APPDATA% to represent that value – this is a Windows Environmental value that stands in as an alias for the actual path.
That’s it – internally, the command-line tool will ensure that your file paths exist, and as long as they do, it will try to run the process and save the output to your specified destination.
Questions? Let me know.