Dataport RecordSeparator Property values

rsaritzkyrsaritzky Member Posts: 469
Hi,

For Dataports, C/Side help says this about the values of the "RecordSeparator" property:

Value: Description
<None>: There will no be RecordSeparator
<NewLine>: (default) "Any combination of CR and LF characters"
<CR/LF>: CR followed by LF
<CR>: CR alone
<LF>: LF alone
<TAB>: Tabulator alone
Other strings: The literal string entered

My question is about the default <NewLine> value.

My interpretation of "Any combination of CR and LF characters" would be that it would detect a <CR><LF>, and perhaps <CR><LF><CR>, but would ALSO detect ONLY a <CR> or ONLY a <LF>. However, my testing has seemed to indicate that when there is ONLY a <CR> character terminating a line, the <Newline> value does NOT detect this as a record separator.

Can anyone confirm my suspicion?

We're downloading data from a bank and trying to dataport it in. But we're discovering that sometimes the CSV from the bank ends its lines in an <LF> only, and sometimes a <CR> only, and sometimes a <CR><LF> - this is the same file downloaded weekly. I'm suspecting that it may have to do with some workstation or session specific settings during the download, but haven't been able to drill down on that yet. So I'm trying to make the Dataport as "accommodating" as possible.

This is NAV2009 SP1 by the way.
Ron

Comments

  • krikikriki Member, Moderator Posts: 9,110
    I have the idea that it is better to write a codeunit with a variable of type File for reading the data. This way you have a lot more control on these things.
    But you need to handle everything yourself.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.