Flat File Schema question

I want to ignore the first few lines of data and take the remaining lines for parsing how do i do it…example data

PACKET# CONTROL NUMBERS PROCESSED PICKUP COUNTS TRAN TO RECEIVER C
SEND RECV INTERCHG GROUP DATE TIME DATE TIME SEGS TSET SEGS NAME C


DOCUMENT TYPE: AFA
4835 0000 000010106 10223 0407 1015 0407 1016 10 1 N/A TECH DATA
4836 9544 000029556 30700 0407 1022 0407 1022 10 1 N/A TNT HOLLAN
4837 6868 000003831 4345 0407 1108 0407 1205 10 1 N/A PRICECOSTC
want to ignore till DOCUMENT TYPE:PFA

It is not possible to parse this data using flatfile schema. Use substring or some other custom service to separate the actual data, and use this data while parsing.

i used substring to seperate the data but now having server service exception while writing the data,i did give the directory path in the psutilities config file.

You were trying to read the below data from the actual data

4835 0000 000010106 10223 0407 1015 0407 1016 10 1 N/A TECH DATA
4836 9544 000029556 30700 0407 1022 0407 1022 10 1 N/A TNT HOLLAN
4837 6868 000003831 4345 0407 1108 0407 1205 10 1 N/A PRICECOSTC

With this, do you want to parse the data, or u want to store it in a file ?

-Senthil

i want to store it in a file and thn later chk for missing fileds,so in some latter point will parse the data from the file

i want to store it in a file and thn later chk for missing fileds,so in some latter point will parse the data from the file

Assuming your record defintions in the FF schema will not match the first several lines in the file you can use the skipToFirstRecord parameter of pub.flatFile:convertToValues to ignore the header lines.

Hi Reamon,

I tried to use skipToFirstRecord parameter by setting to ‘true’. But the initial data matches with the record definition as they are just characters separated by spaces and it is getting parsed.

Also, skipToFirstRecord defaults to true and i think explicitly setting this variable is not required.

Can you guide me how to use this parameter skipToFirstRecord in pub.flatFile:convertToValues service to solve.

Regards,
Senthil

For skipToFirstRecord to work, the schema cannot use a default record type (I think) and the lines leading up to the first record cannot match any record type. If you’re not using a record identifier then skipToFirstRecord probably will not work for that file.

Yes. If it is set to true, it works for flatfile data which contains Record Identifier.

If it is set to false, it gives the error message ‘[FFP.0011.0011] Unrecognized record.’

Thanks
Senthil