我的输入文件有多种格式。我的第一行将被分隔,其余文件将是固定长度。
如何编写我的映射 xml 文件并从 java 中读取它?
我尝试编写多个流,但没有奏效。
我的 mapping.xml 是这样的,
<beanio xmlns="http://www.beanio.org/2012/03"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.beanio.org/2012/03 http://www.beanio.org/2012/03/mapping.xsd">
<stream name="ebcdicFile" format="delimited">
<parser>
<property name="delimiter" value="|" />
</parser>
<record name="header"
class="sft_action_cms_apt_394.sft_action_cms_apt_394.FileSegment">
<field name="fileName" />
<field name="batchCount" />
<field name="totalRecords" />
<field name="maxBatchSize" />
<field name="pickUpTime" />
<field name="errorFlag" />
</record>
</stream>
<stream name="file" format="fixedlength">
<record name="dec"
class="sft_action_cms_apt_394.sft_action_cms_apt_394.pojo">
<field name="tag" length="4" />
<field name="description" length="unbounded" />
</record>
</stream>
</beanio>