每条记录有多个固定宽度的行 - 如何创建模式 [英] Multiple fixed width rows per record - How do I create the schema

查看:65
本文介绍了每条记录有多个固定宽度的行 - 如何创建模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要根据固定宽度的文件创建一个模式。然而,问题是数据的布局。在大多数文件中,1行= 1条记录。简单。但我正在查看一个文件,其中多行组成一个单独的"记录"。更糟糕的是,行可能会有所不同。例如,典型记录将有三行:

CLM1089374659     A3485jug        010499WCSomeInfo
ACN1089374659      QA23Rfo7       010499SomeAdditionalInfo
MCF1089374659      Z655XC5t        010499SomeMoreAdditionalInfo

从我所知,大多数"记录"按照这种模式,但记录可以有额外的细节,这增加了第4行:

CLM1089374659     A3485jug        010499WCSomeInfo
LEG1089374659      ABCD1234       010499SomeLegalInfo
ACN1089374659      QA23Rfo7       010499SomeAdditionalInfo
MCF1089374659      Z655XC5t        010499SomeMoreAdditionalInfo

信息遵循相同的模式。如果只有三行,则为:

CLM
ACN
MCF

如果有四个细节行,它看起来像这样: br />
CLM
LEG
ACN
MCF

平面文件模式向导如何处理这个问题?非常感谢任何帮助。

斯科特

I need to create a schema based on a fixed width file. The problem, however, is the layout of the data. In most files, 1 row = 1 record. Easy. But I am looking at a file in which multiple rows make up a single "record". And to make things worse, the rows may vary. For example, a typical record will have three rows:

CLM1089374659     A3485jug        010499WCSomeInfo
ACN1089374659     QA23Rfo7       010499SomeAdditionalInfo
MCF1089374659     Z655XC5t       010499SomeMoreAdditionalInfo

From what I can tell, most "records" follow this pattern, but records can have additional detail, which adds a 4th row:

CLM1089374659     A3485jug        010499WCSomeInfo
LEG1089374659      abcd1234       010499SomeLegalInfo
ACN1089374659     QA23Rfo7       010499SomeAdditionalInfo
MCF1089374659     Z655XC5t       010499SomeMoreAdditionalInfo

The information follows the same pattern. If there is only three rows, it is:

CLM
ACN
MCF

If there are four detail rows, it look like this:

CLM
LEG
ACN
MCF

How does the Flat File Schema Wizard handle this? Any help is greatly appreciated.

Scott

推荐答案

无法真正帮助向导,但架构应该看起来像这样:

文档分隔后缀0x0D 0x0A
- 记录分隔  InFix 0x0D 0x0A
---- CLN位置标记= CLN
----- -fields
---- LEG位置标签= LEG maxOccurs = 0
------字段
---- ACN位置标签= ACN
---- - 字段
---- MCF位置标记= MCF
------字段
Can't really help with the wizard, but the schema should look like this:

Document delimited Postfix 0x0D 0x0A
--Record delimited InFix 0x0D 0x0A
----CLN positional tag=CLN
------fields
----LEG positional tag=LEG maxOccurs=0
------fields
----ACN positional tag=ACN
------fields
----MCF positional tag=MCF
------fields


这篇关于每条记录有多个固定宽度的行 - 如何创建模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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