CSV is a popular format for tabular data and can be used to export and convert from many sources like Excel or databases to JSON and XML. To make it easy to work with CSV, XML ValidatorBuddy can convert any CSV input to XML or JSON using a dialog that offers various options in a convenient way. To open the dialog select any CSV input document and use theConvert CSV file...command from the File Explorer menu.
The dialog shows a preview of the first 20 lines of the CSV input. This allows to see how the data will be imported and changing any related options like the column separator updates the preview immediately. There is also the output preview which shows how the input CSV data will be converted to XML or JSON. To generate the actual output use the "Convert" button. This will open a new document in the editor with the conversion results in XML or JSON.
Column separator
The CSV import supports three different column separators:
The input preview can be used to check if the CSV can be converted as expected. It will also show, if the first line contains header information to set the column labels.
Many CSV files contain a header line to set the column labels. If the current input comes with a header line, set this option to read the column labels from the first line. As a consequence, the import will then start from the second line.
Below the header line option is a list of column labels. Use the check-box in each line to include or exclude the column in the output. In addition the label text can be edited. The output preview will show the changes to the column labels immediately.
XML ValidatorBuddy supports several methods what JSON or XML structure will be created from the imported CSV data. The following methods are available for the generated JSON:
Click the "Convert" button to start the conversion process and to generate the XML or JSON output. A new document with the conversion result will be opened in XML ValidatorBuddy.