SXI Forum

A place to collect usefull tips, tricks and implementation strategies.

You are not logged in.

#1 22-11-2018 07:09:40

SeanR
Administrator
Registered: 20-11-2018
Posts: 148

CSV Field names

How do you specify the field names in the DataDefinition when collecting data from a row in a CSV file?

Offline

#2 16-08-2020 18:54:21

StephanB
Member
Registered: 21-11-2018
Posts: 39

Re: CSV Field names

This is how, I have it working to collecting data from a CSV file.


<Connector id="Input_File" type="CSV">
     <Connection xsi:type="sxi:CSV">
       <sxi:OutputFileName/>
       <sxi:Delimiter>,</sxi:Delimiter>
       <sxi:RetryDelay>30</sxi:RetryDelay>
     </Connection>
     <sxi:ReturnCodes>
       <sxi:Success>
         <sxi:Code>Success Code</sxi:Code>
       </sxi:Success>
       <sxi:RecoverableError>
         <sxi:Code>Error Code</sxi:Code>
         <sxi:Code>^.*No data collected for field.*$</sxi:Code>
       </sxi:RecoverableError>
     </sxi:ReturnCodes>
</Connector>
<SignalRegistry xsi:type="sxi:SigReg.CSV">
    <sxi:ConnectorID>Input_File</sxi:ConnectorID>
    <sxi:FolderPath>C:\CSVFILES\</sxi:FolderPath>
    <sxi:ActionElement>ProcessCSV</sxi:ActionElement>
    <sxi:FileName>^TestCSV_.*\.csv$</sxi:FileName>
    <sxi:PollingDelay>10</sxi:PollingDelay>
    <sxi:DeleteProcessed>yes</sxi:DeleteProcessed>
    <sxi:ReadHeaders>no</sxi:ReadHeaders>
</SignalRegistry>
<Action name="ProcessCSV">
      <Mappings>
        <Collect dataDefinition="Read_Input_csv" connectorId="Input_File" source="C:\CSVFILES\" lookupField="na" lookupValue="na" />
      </Mappings>
</Action>
<sxi:DataDefinition name="Read_Input_csv">
      <sxi:Fields>

        <sxi:Field name="0">
          <sxi:OutputField datatype="string">TabelName1</sxi:OutputField>
        </sxi:Field>

        <sxi:Field name="2">
          <sxi:OutputField datatype="string">TabelName2</sxi:OutputField>
        </sxi:Field>

        <sxi:Field name="3">
          <sxi:OutputField datatype="string">TabelName3</sxi:OutputField>
        </sxi:Field>

         ........
 
      </sxi:Fields>
</sxi:DataDefinition>

Last edited by StephanB (16-08-2020 18:55:27)

Offline

Board footer

Powered by FluxBB