Import from Text Files
The steps for importing a text file into an XML file are the following:
-
Go to menu
The Select text file dialog will be
displayed.
-
Select the URL of the text file.
-
Select the encoding of the text file.
-
Click the OK button.
The Import Criteria dialog will be displayed:
Import from text file
The input data is displayed in a tabular form. The XML Import
Preview panel contains an example of what the generated XML
document
will look like. The names of the XML elements and the transformation
of the first 5 lines from the text file are
displayed in
the Import settings section. All data items in
the input will be converted by default to element content, but this can be over-ridden
by clicking on the individual column headers. Clicking once on a column header will
cause the data from this column to be used as attribute values
of
the row elements. Click
the
second time
and
the column's data will be ignored when generating the XML file. You can cycle through
these three options by continuing to click on the column header. If the data column will
be converted to element content, the header will contain the <>
symbols.
If the data column will be converted to attribute content, the header will contain the
= symbol. If it will be skipped, the header will contain an x.
-
Select the field delimiter for the import settings:
- comma
- semicolon
- tab
- space
-
Set other optional settings of the conversion.
The dialog offers the following settings:
- First row contains field names - If the option is checked,
you'll notice that the table has moved up. The default column headers are replaced
(where
suchinformation
is available) by the content of the first row. In other words, the
first row is interpreted as containing the field names. The changes are also visible
in the preview of the XML document. To return to
default
settings (where the first row is interpreted as
containing
data and not fields
names),
simply uncheck the option.
- Change labels
-This
button opens a new dialog, allowing you to edit the names of the root and row
elements, change the XML name and the conversion criterion.
The XML names can be
edited by double-clicking on the desired item and entering the required label. The
conversion criterion can also be modified by selecting
one of
the
drop-down
list
options:
ELEMENT, ATTRIBUTE or
SKIPPED.
- Open in editor - If checked, the new XML
document created from the imported text file will be opened in the editor.
- Save in file - If checked, the new XML
document will be saved at the specified path.
Note: If only Open in
editor is checked, the newly created document will be opened in the
editor, but as an unsaved file.