Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: File fith fix header & variable body

  1. #1
    Join Date
    Jun 2007
    Posts
    138

    Default File fith fix header & variable body

    I am generating a file from a DataBase,depending opon some parameters,which i receive from JAVA code.

    Now the expected format for file being generated is having some header.n then variable field is BODY.

    TRASPASO
    4018743112
    703608224600000000000.01
    803608224600000000000.01

    @ Right side,we have fix padding of 00000000000.01 &
    TRASPASO
    4018743112 is our fix header.Now body of file will change each time trasnsformation runs.

    The complication here is,Depending on the name of file,it will be appended or new file will be created.Like if the name is "abc.txt" & the transformation is called 2nd time with the same name then records will be appended.In this case,how i can deal with Fix header..!!?

    I dont have any clue..Wats d way out for this problem?

    I m using kettle 2.5 .

    Thanx..
    Regards,
    kedar.mehta@tcs.com ,
    Tata consultancies Ltd

  2. #2
    Join Date
    Jun 2007
    Posts
    138

    Default Javascript

    Will javascript help me?

    If i add, a java script componenet,which creates the file (having same name,as file output...which i got from GETVariable step) n adds the header.

    Then,in the same flow,File output step will append the records(variable data-Body).

    I am not sure,that in this case,wheather Java Script will work or not..
    Regards,
    kedar.mehta@tcs.com ,
    Tata consultancies Ltd

  3. #3
    Join Date
    Jun 2007
    Posts
    138

    Default Adhoc Solution!!

    The usecases of us,which were meant to be done with Kettle,has to be done with Kettle only.

    By any cost...

    So,by hook n crook We explored a way.We are calling 3 transformations.
    First two just adds header..n third body(real data).All 3 trasformations, appends same file.(I pass same file name from JAVA.)

    I am trying Java script approach now..Hope,even that will work..So at last based on performance..We ll choose the one.

    I know,this isn't good way...But,its not all the time when we can get the Best!!

    Any Suggestions?
    Regards,
    kedar.mehta@tcs.com ,
    Tata consultancies Ltd

  4. #4
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    Personally, given the fact that the file format is so special and proprietary, I would write a plugin for it.

    Matt

  5. #5
    Join Date
    Jun 2007
    Posts
    138

    Default Header

    Thanx matt..

    We tried,JavaScripts even.As of now,we are using those scripts only..

    Writing a plugin is a good but hard way(in terms of implementation)..B caz we want ,is just a simple header.Which is static-fixed.

    Plz consider one request ..In next version of Kettle..Include some such features.So that simple Header can be added into a file..This will make our favourite Tool kettle more Robust!!

    Once more..Thanx.
    Regards,
    kedar.mehta@tcs.com ,
    Tata consultancies Ltd

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.