Home > Cloud Cruiser 4 > Collecting, transforming, and publishing > CSV and Flat File

CSV and Flat File

The ​SmartFlatFileCollector is a reader that is capable of parsing data from simple flat data files (i.e., CSV or fixed-position style data files).

Data mapping

A flat file feed is any text file containing fixed length or delimited data records. Delimited data can be mapped into CC Record content by using both InputField and OutputField or by using OutputField alone to specify the field position as the input value while setting label or labelInput to name resources and identifiers.

Fixed length data requires that InputField objects are defined to describe each field in terms of starting position and ending position or field length.

Spring Batch XML example

<batch:step id="collect_server1" next="collect_server2">
  <batch:tasklet>
    <bean class="com.cloudcruiser.batch.CCRecordCollectTasklet">
      <property name="active" value="true"/>
      <property name="feedName" value="server1"/>
      <property name="collector">
        <bean class="com.cloudcruiser.batch.collect.SmartFlatFileCollector">
          <property name="feedConfig" ref="feedConfig"/>
          <property name="strict" value="true"/>
          <property name="resource" value="file:${env.usageDir}/samples/server1.fixed.txt"/>
        </bean>
      </property>
    </bean>
  </batch:tasklet>
</batch:step>
Last modified

Tags

This page has no custom tags.

Classifications

This page has no classifications.
© Copyright 2018 Hewlett Packard Enterprise Development LP