Flat File Schema Question

Hi All,

I have a FF which has header and lineitem details on same record/line in a flat file. If the header has six line items FF will have six records with same header info with six different values for lineitems. FF has record identifier and fields are separated by “;”.

I created FF schema with record definition (for header) with maxRepeat = unlimited with field definitions and under the same hierarchy created record definition for (line items) with maxRepeat =unlimited with field definitions. My question is how to group data by header.

When I ran the schema with sample FF in results pane it is showing values for the Header only once which is correct, for the lineitems it is not showing the values in the first record:confused: but for showing remaining records…. Am I missing something need suggestions, new to WM.

Here is the sample layout of the FF

INDENTIFIER; A; B; C; D; X1; Y1; Z1;
INDENTIFIER; A; B; C; D; X2; Y2; Z2;
INDENTIFIER; A; B; C; D; X3; Y3; Z3;
INDENTIFIER; A; B; C; D; X4; Y4; Z4;
INDENTIFIER; A; B; C; D; X5; Y5; Z5;
INDENTIFIER; A; B; C; D; X6; Y6; Z6;

Where A, B, C, D are Header fields and X, Y, Z are lineitem fields.

Thanks in advance.

Try doing this:

In your text file do Entries like this


Now first create a flat file dictionary. In your dictionary create two composites:
HEADER : create fields A,B,C,D and give their nth fields as 1,2,3,4 correspondingly

LINEITEMS : create fields X,Y,Z and give their nth fields as 1,2,3 correspondingly

Now create a flat file schema:

specify record sepearator as newline, field seperator as ; and sub-field as ,

Create a record Definition as IDENTIFIER, in that choose composite references, choose the flat file dictionary you created and create the composite references as HEADER and LINEITEMS and give their nth fields as 1 an 2 correspondingly.

So in yor record definition you have two composite references Header and Lineitems with Nth fields as 1 and 2.

Validate your text file with this flat file

Reply if this is the way you want your data