# Filtering Trailer Record

**URL:** <https://forum.cloverdx.com/t/filtering-trailer-record/1429>\
**Category:** CloverDX Platform\
**Created:** [June 18, 2014, 12:00am UTC](https://forum.cloverdx.com/t/filtering-trailer-record/1429 "2014-06-18T00:00:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![skaszyk](https://avatars.discourse-cdn.com/v4/letter/s/977dab/32.png) [@skaszyk](https://forum.cloverdx.com/u/skaszyk)\
**Post date:** [June 18, 2014, 12:00am UTC](https://forum.cloverdx.com/t/filtering-trailer-record/1429/1 "2014-06-18T00:00:00Z")

</div>

I’m using a UniversalDataReader to read a fixed length file that contains both a header and trailer record. I can skip the header record by setting ‘Skip first line’ to true (I see this is deprecated but can’t find a better solution).

However, I’m unable to skip the trailer record. As a result I get an error stating 'Unexpected record delimiter, probably record is too short."

How can I skip trailer records? The files have a variable number of records so I can’t control it by the # of records in the file.

---

<div class="post-metadata">

**Author:** ![slechtaj](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@slechtaj](https://forum.cloverdx.com/u/slechtaj)\
**Post date:** [June 19, 2014, 1:55pm UTC](https://forum.cloverdx.com/t/filtering-trailer-record/1429/2 "2014-06-19T13:55:06Z")

</div>

Hi skaszyk,

Deprecated attribute “ **_Skip first line_** ” can be replaced with “ **_Number of skipped records_** ” (or “ **_Number of skipped records per source_** ” if you read multiple files). Regarding trailing records, you may simply use “ **_Max error count_** ” attribute and set **_Data policy_** attribute to _Controlled_. If you set Max error count to accept just one record that does not match the metadata, it will work the way you want to.

For more information about aforementioned attributes, please refer to our documentation:  
[Data Policy -](http://doc.cloveretl.com/documentation/UserGuide/index.jsp?topic=/com.cloveretl.gui.docs/docs/data-policy.html)[http://doc.cloveretl.com/documentation/ … olicy.html](http://doc.cloveretl.com/documentation/UserGuide/index.jsp?topic=/com.cloveretl.gui.docs/docs/data-policy.html)  
[UniversalDataReader -](http://doc.cloveretl.com/documentation/UserGuide/index.jsp?topic=/com.cloveretl.gui.docs/docs/datareader.html)[http://doc.cloveretl.com/documentation/ … eader.html](http://doc.cloveretl.com/documentation/UserGuide/index.jsp?topic=/com.cloveretl.gui.docs/docs/datareader.html)

Hope it helps.

---

<div class="post-metadata">

**Author:** ![skaszyk](https://avatars.discourse-cdn.com/v4/letter/s/977dab/32.png) [@skaszyk](https://forum.cloverdx.com/u/skaszyk)\
**Post date:** [June 20, 2014, 3:21pm UTC](https://forum.cloverdx.com/t/filtering-trailer-record/1429/3 "2014-06-20T15:21:24Z")

</div>

Worked perfectly! Thanks for the reply and the detailed links, very helpful.
