Parse CSV and Load Data to Data Feed

This example shows how to parse a CSV file and load it into a Data Source (DMDS).

sku,label,price
1,BMW,10
2,AUDI,20
3,Skoda,10
4,Opel,20
5,Mercedes,10
6,Seat,20
7,Porsche,10
8,Peugeot,20
XML
<pfx:loadMapper id="carsMapper" convertEmptyStringToNull="true">
    <pfx:body in="sku"/>
    <pfx:body in="price"/>
</pfx:loadMapper>

.....

<route>
    <from uri="file:src/data-4?noop=true"/>
    <split>
        <tokenize token="\n" group="5000"/>
        <to uri="pfx-csv:unmarshal?header=sku,label,price&amp;skipHeaderRecord=true"/>
        <to uri="pfx-api:loaddata?mapper=carsMapper&amp;objectType=DM&amp;dsUniqueName=1849.DMDS"/>
    </split>
    <!-- Flush is required to make data visible in analytics -->
    <to uri="pfx-api:flush?objectType=DM&amp;dsUniqueName=1849.DMDS"/>
</route>