Import Text File
This command lets you import any structured text file into XMLSpy and convert it to XML format immediately. This is useful when you want to import legacy data from older systems. The steps for importing data in a text file as an XML document are described below.
1.Select the menu item Convert | Import Text File.
2.In the dialog that appears (screenshot below), select one of the two options. (For the mapping option to work, Altova MapForce must be installed.)
3.Click OK. The Text Import dialog appears.
4.Select the text import options you want (described in the next section) and click Import. The imported data is converted into an XML document and this is displayed in Grid View.
Text Import options
The text import options are specified in the Text Import dialog (screenshot below) and are described below. See previous section for information on accessing the dialog..
Path
Enter the path to the file to import in the Path text box, or select the file using the Browse button to the right of the text box. After the file is selected, a Grid View preview of the XML file is displayed in the Preview pane. Any change in the options selected in this dialog will be reflected in the preview immediately.
Delimiter
To successfully import a text file, you need to specify the field delimiter that is used to separate columns or fields within the file. XMLSpy will auto-detect common row separators (CR, LF, or CR+LF).
String quotes
Text files exported from legacy systems sometimes enclose textual values in quotes to better distinguish them from numeric values. If this is the case, you can specify what kind of quotes are being used in your file, and remove them automatically when the data is imported.
Encoding
The data is converted into Unicode (the basis of all XML documents), so you need to specify which character-set the file is currently encoded in. For US or Western European Windows systems this will most likely be Codepage 1252, also referred to as the ANSI encoding.
Byte order
If you are importing 16-bit or 32-bit Unicode (UCS-2, UTF-16, or UCS-4) files, you can also switch between little-endian and big-endian byte order.
First row contains column names
It is also very common for text files to contain the field names in the first row within the file. If this is the case, check this check box.
Preview
In the Preview pane you can rename column headers by clicking in a name and editing it. The column headers will be the element or attribute names in the XML document. You can also select whether a column should be an element or an attribute in the XML document, or whether it should not be imported into the XML document. Click the column-type icon in each column header to toggle through these options. For example, in the screenshot above, the Longitude in Seconds column (LonS) will not be imported.