0

We receive an excel file that has 2 columns of data. We save this file as csv and use BeanIO to read the csv. On occasion the excel will have empty columns after the 2 columns. When we save to csv these extra columns are included and we get a Beanio exception

"too many fields ... etc"

Is there a way to configure BeanIO to ignore multiple columns after a certain point e.g

<stream>
  <record>
    <field name="name" />
    <field name="email" /> 
    <field name="blank" ignore="true" minOccurs="0" />
  </record>
</stream>

So read the name and email columns but ignore any columns after this. There could be one or more columns to ignore.

Thanks

A.McCoy
  • 19
  • 1
  • 5

1 Answers1

0

Suggestion (not verified ) define the blank fiels as a list on your bean and map it like

<field name="blank" type="String" collection="list" minOccurs="0" maxOccurs="unbounded"/>
Greg Henry
  • 61
  • 6