Customer Portal

CSV conversion to Database

Comments 1

  • Avatar
    oldforum
    0
    Comment actions Permalink
    First you have to extract/parse your CSV file. For this purpose is in the clover engine component called "Delimited data reader NIO", in which you can define location of your input CSV file. Next for loading this way parsed data into database you can use "DB output table" component. These components you must connect with edge. To this edge assign metadata, which describe your input data. In CloverGUI we have wizard for this purpose.

    Description of all standard component you can find in documentation tab on this web site (http://cloveretl.berlios.de/docs/Clover ... nents.html)

    Example:
    <?xml version="1.0" encoding="UTF-8"?>
    <Graph name="graphByKokon3">
    <Global>
    <Metadata id="Metadata1">
    <Record name="Orders" type="delimited">
    <Field name="OrderID" type="numeric" delimiter="|" format="#" nullable="true"/>
    <Field name="CustomerID" type="string" delimiter="|" nullable="true"/>
    <Field name="EmployeeID" type="string" delimiter="|" nullable="true"/>
    <Field name="OrderDate" type="date" delimiter="|" format="dd.MM.yyyy" nullable="true"/>
    <Field name="RequiredDate" type="date" delimiter="|" format="dd.MM.yyyy" nullable="true"/>
    <Field name="ShippedDate" type="date" delimiter="|" format="dd.MM.yyyy" nullable="true"/>
    <Field name="ShipVia" type="integer" delimiter="|" format="#" nullable="true"/>
    <Field name="Freight" type="numeric" delimiter="|" format="#" nullable="true"/>
    <Field name="ShipName" type="string" delimiter="|" nullable="true"/>
    <Field name="ShipAddress" type="string" delimiter="|" nullable="true"/>
    <Field name="ShipCity" type="string" delimiter="|" nullable="true"/>
    <Field name="ShipRegion" type="string" delimiter="|" nullable="true"/>
    <Field name="ShipPostalCode" type="string" delimiter="|" nullable="true"/>
    <Field name="ShipCountry" type="string" delimiter="\r\n" nullable="true"/>
    </Record>
    </Metadata>
    <DBConnection id="DBConnection1" driverLibrary="file:/C:/Martin/install/jdbcDrivers/pg74.216.jdbc3.zip" dbDriver="org.postgresql.Driver" user="test" name="postgre connection" password="xxx" dbURL="jdbc:postgresql://koule/foodmart"/>
    </Global>
    <Phase number="0">
    <Node id="DB_OUTPUT_TABLE0" type="DB_OUTPUT_TABLE" dbTable="kokonorders" enabled="enabled" dbConnection="DBConnection1" guiX="376" guiY="23" guiWidth="0" guiHeight="0" guiName="DB Output Table"/>
    <Node id="DELIMITED_DATA_READER_NIO0" type="DELIMITED_DATA_READER_NIO" fileURL="C:/Martin/eclipse 3.1/runtime-workspace/p/data/orders.dat" enabled="enabled" guiX="20" guiY="20" guiWidth="0" guiHeight="0" guiName="Delimited Data Reader (New I/O)"/>
    <Edge id="Edge1" fromNode="DELIMITED_DATA_READER_NIO0:0" toNode="DB_OUTPUT_TABLE0:0" outPort="0 (Delimited Data Reader (New I/O))" inPort="0 (DB Output Table)" guiBendpoints="" metadata="Metadata1"/>
    </Phase>
    </Graph>

    Please try open this graph in CloverGUI (http://www.clovergui.net/) for better visualisation.

    GL, OtaSanek

Please sign in to leave a comment.