Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Reading excell using kettle api

  1. #1
    Join Date
    Jul 2007
    Posts
    2

    Smile Reading excell using kettle api

    hai i am a newbie in Pentaho Data Integration[Kettle].i want to read a excel file and write this data to a table.I have already done the reverse process.but i failed to read the excel .have any document or any other help related to this?????Thanks in advance for helping.

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    Use Excel input step... but it will only work on "rectangular" data... think rows.

    What error do you get?

    Regards,
    Sven

  3. #3
    Join Date
    Jul 2007
    Posts
    2

    Default

    i am using ExcelInputMeta my code is as below


    ExcelInputMeta eii =
    new ExcelInputMeta();
    eii.setFileName(sourceFileName);
    ExcelInputField field1 =
    new ExcelInputField(sourceFields[0],0,3);
    ExcelInputField field2 =
    new ExcelInputField(sourceFields[1],1,3);
    ExcelInputField fields[] ={field1,field2};
    eii.setField(fields);
    eii.setAcceptingFilenames(
    true);
    eii.setStartsWithHeader(
    true);
    eii.setIgnoreEmptyRows(
    true);
    eii.setStopOnEmpty(
    true);

    and the error corrosponding to this code ---
    2007/07/20 16:49:21 - ExcelToTable - Dispatching started for transformation [ExcelToTable]
    2007/07/20 16:49:21 - ExcelToTable - This is not a replay transformation
    2007/07/20 16:49:21 - ExcelToTable - This transformation can be replayed with replay date: 2007/07/20 16:49:21
    2007/07/20 16:49:21 - ExcelToTable - Initialising 3 steps...
    2007/07/20 16:49:21 - read from [[Ljava.lang.String;@1034bb5] - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) : Error initializing step [read from [[Ljava.lang.String;@1034bb5]]
    2007/07/20 16:49:21 - read from [[Ljava.lang.String;@1034bb5] - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) :
    java.lang.NullPointerException

    2007/07/20 16:49:21 - read from [[Ljava.lang.String;@1034bb5] - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) : at be.ibridge.kettle.core.util.StringUtil.environment Substitute(
    StringUtil.java:163)
    2007/07/20 16:49:21 - read from [[Ljava.lang.String;@1034bb5] - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) : at be.ibridge.kettle.trans.step.fileinput.FileInputLi st.createFileList(
    FileInputList.java:78)
    2007/07/20 16:49:21 - read from [[Ljava.lang.String;@1034bb5] - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) : at be.ibridge.kettle.trans.step.fileinput.FileInputLi st.createFileList(
    FileInputList.java:69)
    2007/07/20 16:49:21 - read from [[Ljava.lang.String;@1034bb5] - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) : at be.ibridge.kettle.trans.step.excelinput.ExcelInput Meta.getFileList(
    ExcelInputMeta.java:915)
    2007/07/20 16:49:21 - read from [[Ljava.lang.String;@1034bb5] - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) : at be.ibridge.kettle.trans.step.excelinput.ExcelInput .init(
    ExcelInput.java:648)
    2007/07/20 16:49:21 - read from [[Ljava.lang.String;@1034bb5] - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) : at be.ibridge.kettle.trans.step.StepInitThread.run(
    StepInitThread.java:45)
    2007/07/20 16:49:21 - read from [[Ljava.lang.String;@1034bb5] - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) : at java.lang.Thread.run(
    Thread.java:619)
    2007/07/20 16:49:21 - write to [r_test].0 - Connected to database [target] (commit=200)
    2007/07/20 16:49:21 - ExcelToTable - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) : Step [read from [[Ljava.lang.String;@1034bb5].0] failed to initialize!
    2007/07/20 16:49:21 - ExcelToTable - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) : We failed to initialize at least one step. Execution can not begin!
    2007/07/20 16:49:21 - ExcelToTable - Transformation ended.

  4. #4
    Join Date
    May 2006
    Posts
    4,882

    Default

    aah, in such a case I would rather suggest to build in a java program to load a .ktr file and run that (like the pan command line utility).

    Now check out pan... and get the Environment initialization from that utility and use it in yours. You didn't initialize your environment.

    Regards,
    Sven

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.