This discussion is archived
4 Replies Latest reply: Nov 21, 2012 6:55 AM by JeromeFr RSS

Loading Flat file into Table

947775 Newbie
Currently Being Moderated
Hi ,

I have a scenario , where i am getting a file like this


here my first row is date , when file arrived

and end row give me count of rows

so i want to load this information into table ,

so how can i do it

and the same thing if i want to put into the file , how it will possible

please help me in this
  • 1. Re: Loading Flat file into Table
    496810 Explorer
    Currently Being Moderated
    is this going to be the regular pattern of the file? if so, no can define 4 columns..the first being date..and so..on..creating a source datastore and map accordingly to the target..
  • 2. Re: Loading Flat file into Table
    947775 Newbie
    Currently Being Moderated
    It is not that straight forward

    i want to load the first row data which came as 20112012 in a separate column let's say insert_date

    and the count of rows exclude the first row and last row i will take the count of the rows and try to insert into one table..
  • 3. Re: Loading Flat file into Table
    A. Drieux Pro
    Currently Being Moderated
    I assume there is only 1 "date row", and it's always the first row of the file ?

    If so, you should extract this date in an ODI Variable.
    Then ignore this first row in your ODI interface. But use the variable to populate your "insert_date" column.

    If you can't directly read the file to extract this row, create a specific interface that will load your flat file with the filter ROWNUM=1 (filter on staging area zone). This interface will only extract the date in a temporary table. You can use the "yellow interface" for that.
    Then, an ODI variable will read the date in the "yellow datastore table".
  • 4. Re: Loading Flat file into Table
    JeromeFr Expert
    Currently Being Moderated
    I hope the last value will not generate an error.

    If it goes well, add a filter in the interface loading your file : DATASTORE_ALIAS.C2 IS NOT NULL.
    It will ensure that your last value will not be loaded.


  • Correct Answers - 10 points
  • Helpful Answers - 5 points