Text file structure
A text file used for report data must have the following structure:
*The first line of the text file can contain the names of the columns, separated by commas. If the first line does not contain column names, BIRT assigns default names, such as Column_1, Column_2, and so on.
*The second line of the file can specify the data types of the columns. See Table 7‑1 for a list of supported data types. If you use the second line to specify data types, list the data types in the same order as the columns, and separate the data types with a comma, semicolon, tab, or pipe.
*The remaining lines in the file must contain values for the columns. The values can be separated by a comma, semicolon, tab, or pipe.
*Each line must contain the same number of fields.
*The file cannot include empty lines between records.
*Each record must occupy a separate line, delimited by a line break, such as CRLF or LF. The last record in the file can either include or omit an ending line break.
*Data in a field can be surrounded by more than one set of quotation marks. Quotation marks are required only if the data contains one or more commas within a field. A field can enclose single quotation marks and commas with double quotation marks, such as:
"He said, 'Yes, I do.'"
*If a field without content has zero or more spaces, the field is treated as NULL and evaluated as NULL in comparison operations.
*The file name and extension can be any name that is valid for your operating system. Although TXT and CSV are typical, you do not have to use either as the file extension.
The following example shows a valid sample text file. The text file has two lines of metadata and three lines of data. The first line lists the column names, and the second line lists the data types.
FamilyName,GivenName,AccountID,AccountType,Created
STRING,STRING,INT,STRING,TIMESTAMP
"Smith","Mark",254378,"Monthly",01/31/2003 09:59:59 AM
"Johnson","Carol",255879,"Monthly",09/30/2004 03:59:59 PM
"Pitt","Joseph",255932,,10/01/2005 10:32:04 AM