• Convert CSV data to XML or JSON

Convert CSV data to XML or JSON

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 the Convert 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.
Convert CSV data to XML or JSON

Column separator

The CSV import supports three different column separators:
  • Semicolon
  • Comma
  • Tabulator

Encoding of CSV input

2. Encoding of CSV input
Please select the encoding according to the CSV input. By default a standard ASCII encoding is selected.

CSV preview

3. CSV preview
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.

CSV header line check

4. CSV header line check
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.

Column selector for  generated output

5. Column selector for  generated output
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.

Output format

The CSV data can be converted into XML or JSON using this option.

Conversion method

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:
  • A JSON object as array item for each CSV row
  • A JSON array for each CSV row
  • A JSON array for each CSV column

Output preview

8. Output preview
Please note that the Output preview will only show the data from the first 20 lines of the CSV input.

Convert button

9. Convert button
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.