ASCII Static File Extension/Parser
Author: jcranwellward
Creation Date: 3/12/2009 3:26 PM
profile picture

jcranwellward

#1

Hi guys,

I am using the ASCII parser to load some csv data.

I have the standard DateTime/O/H/L/C.

I also have 4 other columns that I add as custom fields. Some have data for some days and some do not.

My question is does the ASCII parser treat empty fields (ie ,,,,) as null data or will it assume the end of the row has been reached?

I am not able to parse in my extra fields because the parser throws an exception: "Incorrect number of fields or incorrect fields separator"

If I remove these custom fields and just go with DateTime/O/H/L/C it parses fine.

Thanks for your time.

James
profile picture

Eugene

#2
QUOTE:
I am not able to parse in my extra fields because the parser throws an exception: "Incorrect number of fields or incorrect fields separator"


This is a case of "Garbage in - garbage out".

Custom data fields can contain only numerical data, and it can't be null. The same error you would see, for example, if any part of the OHLC sequnce for some bar was missing. In this case, the number of fields is really incorrect because -- the data is missing, or there was a parser error.

The ASCII provider here is working as designed, and does a good job. It would be actually much worse if you weren't aware of garbage in your data or a missing value, or parser error, but the adapter would helpfully create an imaginary value like 0 or -1 instead of what is there i.e. null.

If your data vendor isn't capable of chaning their data format, you could probably fix it by replacing the sequence in Notepad (or with a Regex, a script etc.)
profile picture

jcranwellward

#3
Hi Eugene,

Thanks for the response.

That explains the error im having.

James
profile picture

Eugene

#4
James

Only in case you're not interested in these custom data fields, you may mark them as "Filler" fields to get rid of them.