Search

 

Module:Editor

Version: 5.3 +

Type: String

Category:Conversion

 

Description

The formula 'ConvertCSVtoXML' converts data in a CSV-file to XML. The CSV file should not have more elements than headers, otherwise this will result in an error.

Parameters

CSV:

In the parameter 'CSV' comes the contents of the CSV-file as a text string. This can be done by the formula 'ReadFile'. When reading CSV, the CSV-file has to be closed.

FieldSeparator:

This is the character that is used in the CSV-file for the separation of the fields. You can use "AUTODETECT" to automatically detect if the file contains a ',' or a ';' as a fieldseparator.

FirstRowContainsHeaders:

This parameter can be True or False. If the CSV-file contains headers and you want to use this headers in XML, then you can set this parameter on 'True'. When you choose False, you have to provide the headers in parameter 'FieldNames'.

DataElementName:

This is the name used in the top XML element.

RowElementName:

This is the name used in for the top row element in XML.

IncludeRowNum:

This parameter can be True or False. Here you can specify whether to include the row numbers of the CSV file as attributes in the row elements or not.

Fieldnames:

Here you can specify a table with field names. This are the headers of the columns in the output XML. This parameter will only be used if the paramater 'FirstRowContainsHeaders' is set to False. The number of fieldnames specified have to be the same as the number of columns in the CSV-file.

Example

Description

You can see below what possible parameters for the formula 'ConvertCSVtoXML' are.

Values parameters

CSV:

ReadFile (Path to the CSV-file)

FieldSeparator:

';' (depends on what is specified in the CSV-file)

FirstRowContainsHeaders:

True

DataElementName:

TopElement (Title)

RowElementName:

ChildElement

IncludeRowNum:

False

FieldNames:

Table (string[0x0])

Result

The result is a XML-file that can be used in the editor as input.

Feedback

If you have any questions about this subject or if you want to provide us feedback please send us an e-mail.

Updated:2014-11-25