# Is this a bug in the DataParser?

**URL:** <https://forum.cloverdx.com/t/is-this-a-bug-in-the-dataparser/904>\
**Category:** CloverDX Platform\
**Created:** [July 28, 2011, 12:00am UTC](https://forum.cloverdx.com/t/is-this-a-bug-in-the-dataparser/904 "2011-07-28T00:00:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhgrove](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.cloverdx.com/mhgrove/32/95_2.png) [@mhgrove](https://forum.cloverdx.com/u/mhgrove)\
**Post date:** [July 28, 2011, 12:00am UTC](https://forum.cloverdx.com/t/is-this-a-bug-in-the-dataparser/904/1 "2011-07-28T00:00:00Z")

</div>

This file does not parse using the standard DataReader:

> col1,colb  
> f,4  
> 0,7

This however does parse (note the missing trailing 4 on the first record):

> col1,colb  
> f,  
> 0,7

The error message I get is:

```auto
Parsing error: Unexpected record delimiter, probably record has too few fields. in field # 2 of record # 1, value: 'f,4
'

```

What it looks like is happening is that I’m getting to the last record and the data in the field buffer is “4\r\n” and it doesnt recognize that 4 is a field value and then the delimiter, it just assumes the whole thing is the delimiter and dies since it thinks its missing the last field.

I have seen similar cases where the \r\n at the end of a line is not recognized and the last value of one record is concatenated with the first value of the next record and that completely throws off parsing.

The data is a CSV created on a windows machine. The delimiter on the last field of my metadata is defined as delimiter=“,\\|;\\|:” and the rest are delimiter=“,” and the Record element itself declares: fieldDelimiter=“,” recordDelimiter=“\n”

Is this a bug, or have I just not yet hit upon the magical incantation for actually getting delimited data to parse?

This is with Clover 3.1.0.

---

<div class="post-metadata">

**Author:** ![avackova](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@avackova](https://forum.cloverdx.com/u/avackova)\
**Post date:** [July 29, 2011, 10:47am UTC](https://forum.cloverdx.com/t/is-this-a-bug-in-the-dataparser/904/2 "2011-07-29T10:47:44Z")

</div>

Hello Mike,  
I tried it with following metadata:

```auto
<Metadata id="Metadata1" previewAttachmentCharset="ISO-8859-1">
<Record fieldDelimiter="," name="sample_txt" previewAttachmentCharset="ISO-8859-1" recordDelimiter="\n" type="delimited">
<Field delimiter=",\\|;\\|:" name="cola" type="string"/>
<Field name="colb" type="string"/>
</Record>

```

And the parsing works properly. Of course there is unneeded _/r_ on the end in the last field, but the exception is not thrown.
