Hi,
I am trying to read some data from a flat file which has header, body and footer. The body content type is described in meta file. While reading the file using skipFirstLine attribute I can escape the first line, but the footer is giving an error message that it is not matching as per meta file. How can I resolve this problem.
Also all the data has a mode section to identify it is header, body or footer like:
0|HEADER|2009-07-10|FILE NAME|
1|ABC|A B C|
1|CDF| C D F|
2|FOOTER
please note the end of file is in the last line itself.
Tha graph is running well if I give same number of delimiters and a paragraph after last line.
Ex:
0|HEADER|2009-07-10|FILE NAME|
1|ABC|A B C|
1|CDF| C D F|
2|FOOTER||
Can any one please help me sorting out this problem.
Thanks,
Amit
Hello Amit,
As regards your question, I would like to advise you not to forget the possibility of the Data policy attribute.
You can switch its default setting (Strict, which causes fails of the graph by each error).
You can select the other two options: either Controlled, which saves errors to console, or Lenient, which ignores errors and does not save them.
In both cases, graph does not fail. If you want to parse the mentioned file, set the Skip first line to true. And switch Data policy to any other value than the default Strict.
It will work, of course, if you do not want to save also the footer.
Best regards
Tomas Waller
Or you can consider to use the MultiLevelReader component.
Thanks for your help. By setting the datapolicy attribute in reader component to lenient the graph ran successfully.