Define a File Model
This page describes how to define a file server metadata and reverse-engineer files stored on this server.
Create a File Model
To create a new File metadata file:
-
Click the New Metadata button in the Project Explorer toolbar. The New Model wizard opens.
-
In the Choose the type of Metadata tree view, select File > File Server.
-
Click Next.
-
Select the parent folder or project for your new resource.
-
Enter a File Name and then click Finish. The metadata editor opens.
-
Select the Server node. In the Properties view, set the following properties:
-
Name: A user-friendly name for this schema. The Server node is renamed with this name.
-
Driver:
com.semarchy.xdi.jdbc.file.FileDriver
-
URL:
jdbc:semarchy:file
-
-
Right-click the root node of the file model editor and then select Actions > Launch Directory wizard.
-
In the Directory page, provide a user-friendly Name for the directory and select its Path.
-
Click Next.
-
On the File Properties page:
-
Use the Browse button to select the file in the directory and set the Physical Name for the file.
-
Set a logical Name for the file datastore.
-
Select the file Type: Delimited or Positional (fixed-width fields).
-
-
Depending on the selected file Type, follow the instructions provided in Reverse-Engineer a Delimited File or Reverse-Engineer a Fixed-Width File.
Reverse-Engineer a Delimited File
To reverse-engineer a delimited file:
-
In the File Properties page, use the Refresh button to view the content of the file in the preview. Expand the wizard size to see the file contents.
-
Set the following parameters to match the file structure:
-
Charset Name: Code page of the text file.
-
Line Separator: Character(s) used to separate the lines in the file.
-
Field Separator: Character(s) used to separate the fields in a line.
-
String Delimiter: Character(s) delimiting a string value in a field.
-
Decimal Separator: Character used as the decimal separator for numbers.
-
Lines to Skip: Number of lines to skip from the beginning of the file. This count must include the header.
-
Header Line Position: Position of the header line in the file.
-
-
Click Next.
-
Click Reverse. If the parameters set on the previous page are correct, the list of columns detected in this file is automatically populated.
-
Reverse-engineering parses through a number of lines in the file (defined by the Row Limit) to infer the data types and size of the columns. You can tune the reverse behavior by changing the Reverse Options and Size Management properties, and clicking Reverse again.
-
You can manually edit the data type, size, and name of detected columns in the table.
-
-
Click Finish to complete the reverse-engineering.
-
Press Ctrl+S to save the metadata.
Reverse-Engineer a Fixed-Width File
To reverse-engineer a fixed-width file:
-
In the File Properties page, use the Refresh button to view the content of the file in the preview. Expand the wizard size to see the file contents.
-
Set the following parameters to match the file structure:
-
Charset Name: Code page of the text file.
-
Line Separator: Character(s) used to separate the lines in the file.
-
Decimal Separator: Character used as the decimal separator for numbers.
-
Lines to Skip: Number of lines to skip from the beginning of the file. This count must include the header.
-
Header Line Position: Position of the header line in the file.
-
-
Click Next.
-
Click Refresh to populate the preview.
-
From this screen, you can add, move and edit column definitions for the file. If you add columns, the preview shows the position of the columns in the file.
-
Click Finish to complete the reverse-engineering.
-
Press Ctrl+S to save the file.