BizTalk2013r2平面文件架构向导,用于嵌套重复记录 [英] BizTalk2013r2 Flat File Schema wizard for nested repeating records

查看:73
本文介绍了BizTalk2013r2平面文件架构向导,用于嵌套重复记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从具有重复行的.csv文件中创建平面文件架构:

I need to create a Flat file schema out of a .csv file having repeated lines:

#Constant

#Constant

#Date:1.1.1999

#Date: 1.1.1999

Type1; xxx; yyy; zzz; aaa; bbb

Type1;xxx;yyy;zzz;aaa;bbb

Type2; xxx; yyy; zzz; aaa; bbb

Type2;xxx;yyy;zzz;aaa;bbb

Type3; xxx; yyy; zzz; aaa; bbb

Type3;xxx;yyy;zzz;aaa;bbb

0; 123; 222; 333; 444

0;123;222;333;444

1; 1; 22; 333; 2; 22

1;1;22;333;2;22

1; 2; 33; 22; 2; 22

1;2;33;22;2;22

1 ;;;; 33; 3; 33

1;;;33;3;33

2; 100; 22; 1; 222; 11; 22

2;100;22;1;222;11;22

0; 23; 22; 33; 44

0;23;22;33;44

1; 2; 11; 22; 11; 22

1;2;11;22;11;22

1; 22; 11; 22; 22; 33

1;22;11;22;22;33

0; 23; 22; 55; 66

0;23;22;55;66

1; 22; 11; 22; 66; 77

1;22;11;22;66;77

如您所见,类型0,1、2的行正在重复.

As you can see the rows of type 0,1 and 2 are repeating.

我尝试创建将#Constant直到Type3作为字段元素并将0,1,2行作为具有各自标签标识符的重复记录的平面文件.但是由于这些行是重复的,所以在验证架构实例时出现错误.

I tried to create flat file considering #Constant till Type3 as field elements and 0,1,2 rows as repeating records with their respective tag identifiers. But since these rows are repeating , i am getting error while validating schema instance.

推荐答案

您可以使用平面文件模式向导和一些手动修改来创建模式.

You can create the schema using the flat file schema wizard and some manual modification.

从向导开始.

首先为重复部分创建模式:选择第一行行0,1,1,1,2,将定界符留空(删除默认值)并将元素类型设置为重复记录".默认名称为Root_Child1.

First create the schema for the repeating part: select the first block of lines 0,1,1,1,2, leave the delimiter empty (remove the default value) and set element type to "Repeating record". The default name will be Root_Child1.

使用CRLF作为分隔符将其解析为子节点.将行0,​​第一行1和第2行的元素类型设置为重复记录",并将第二行和第三行的元素类型设置为忽略".最后将得到三个子记录(Root_Child1_Child1Root_Child1_Child5).

Parse it into child nodes with CRLF as delimiter. Set the element type of line 0, the first line 1 and line 2 to "Repeating record" and set it to "Ignore" for the second and third line 1. You will end up with three child records (Root_Child1_Child1, Root_Child1_Child2 and Root_Child1_Child5).

使用分号作为定界符并将标签标识符分别设置为0, 1 and 2,继续将这些子记录解析为字段.最后,在代表第2行(Root_Child1_Child5)的记录节点上,将Min Occurs最小化为0.

Continue parsing these child records into fields using the semicolon as delimiter and setting tag identifiers to 0, 1 and 2 respectively. Finally, on the record node representing line 2 (Root_Child1_Child5) modify Min Occurs to 0.

现在在Root_Child1之前手动添加一个同级记录节点以表示常量块.右键单击它,然后选择"Define Record from Flat File Instance".选择前五行,将分隔符留空,并将元素类型设置为Record.继续以CRLF为分隔符将记录解析为5个子记录.然后,您可以根据需要将这些子记录解析为带有分号分隔符的字段节点.

Now manually add a sibling record node before Root_Child1 to represent the constant block. Right click it and select "Define Record from Flat File Instance". Select the top five lines, leave the delimiter empty and set the element type to Record. Continue by parsing the record into 5 child records with CRLF as delimiter. You can then parse those child records into field nodes with a semicolon delimiter if you wish.

这篇关于BizTalk2013r2平面文件架构向导,用于嵌套重复记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆