6

Our client sends us a flat file as input, which we then take and convert to an XML file before sending to the destination system.

The flat file consists of multiple lines, each line is delimited by LF or CRLF.

How do I create a Flat File Schema so that BizTalk can interpret each line of data regardless of whether the line was delimited by LF (0x0A) or CRLF (0x0D 0x0A)?

4

3 に答える 3

7

問題が解決しました。他の誰かが疑問に思っている場合の解決策は次のとおりです。

LFとCRLFはどちらもLF文字を共有しているため、行区切り文字をLF(0x0A)に設定しました。これは、完全なレコードを抽出するために正しく機能します(CRLFが区切り文字である場合、最後に1つの余分なCR文字があるという副作用があります)。

ダミーフィールドを使用してCR文字を吸収するか、マップを使用して、余分なCR文字を取り除くことができます。

LF区切り文字とCRLF区切り文字の長さが異なるため(それぞれ1文字と2文字)、両方が正しく処理されるように、スキーマにさらに2、3の変更を加える必要があることに注意してください。

私のシナリオでは、解析された各行レコードに8つの位置フィールドが含まれているため、最後に追加のCR文字があると、Biztalkが追加のCR文字を考慮しない最後のフィールドに特定の長さを期待しているため、エラーが発生しました。解決策は、8番目のフィールド(私の場合はフィラーフィールド)の長さを1増やすことです。ただし、LF行区切り文字を引き続き処理できるようにするには、必ず「早期終了を許可」フラグを設定してください。 TRUEに。このように、最後のフィールドが割り当てられた長さより1文字短い場合(CR文字が含まれていなかった場合)、エラーはスローされません。

于 2010-04-22T18:41:42.557 に答える
4

Forgive me if I misunderstand the question... it sounds as if each line is a record, but some lines end in LF and others in CRLF, and you need to have both as a delimiter at the same level?

I don't know of a way to specify more than one child delimiter with the flat file schema by itself, but one possible solution could be to write a custom pipeline component for the decode stage of your receive pipeline to replace the CRLFs with LFs, then use LF as the delimiter on the flat file schema.

于 2010-04-22T17:43:56.177 に答える
0

A simple approach is to set LF as the delimiter and CR as the padding character at the schema level. In case the schema works when testing via Visual Studio but errs out in the pipeline, flip Infix/Postfix values. No need to select Allow Early Termination.

于 2018-05-29T01:39:35.943 に答える