- Print
- PDF
Input files in CSV format are automatically converted to XML. Handling and processing CSV input form type in the Lasernet Form Editor application is similar to the operations with the XML input form type.
When a .csv grab file opens, it is automatically converted to XML.
Exercise
Download and import the attached configuration called 02. CSV in Lasernet Developer 9. Afterward, follow these steps:
On the Tools panel, click Forms to open a form area.
Click the Add button on the top toolbar.
Otherwise, you can drag the Form item to the form area. As one more alternative, you can right-click in the form area and then click Add in the context menu that appears.
Enter the name of the new form (Sample) in the Name field.
Select CSV as an input format.
Once you are done, click Ok to confirm adding a new form.
Open the Sample form you have just added for editing. To this end, select it, and then click the Edit button on the toolbar. Otherwise, you can right-click the form and then select Edit on the context menu that appears, or just double-click the form.
Open a grab file named Sample. To this end, on the Form menu, click Select Grab File(s).
In the Select Grab File(s) dialog that opens select the Copy of Sample folder, then select the Sample file, and then click Open.
You are now proposed to modify the input form options to convert CSV to XML according to the format of the Sample.csv file. To this end, follow these steps:
On the Form menu, click Form Options.
In the Form Options dialog displayed, switch to the CSV tab.
Selecting the First line contains headers check box means that Lasernet uses header names in the XML file, and the first line is skipped as it does not contain data.
From the Field separator drop-down box, select a semicolon (;).
See the following image to compare the XML file structures before and after changing the form options: