Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Mixed Header and Detail in Inbound CSV

  1. #1

    Question Mixed Header and Detail in Inbound CSV

    Hi,
    This has probably been addressed elsewhere, but I cannot find this or figure the issue out.

    How do I deal with a situation like the following:

    HEADER REC: H1 | H2 | H3 ...etc
    DETAIL REC: D1 | D2 | D3 | D4 | D5 ...etc

    So you might have:

    H............................
    D............................
    D............................
    D............................
    H............................
    D............................
    D............................
    H............................
    D............................

    I've tried using two TextInput's one setup for the Detail format and another for the Header, using filters to strip out the "unwanted" rows.

    The problem I am having is how do I "zip" them back together after processing the individual row?

    There are two scenarios: In one case, I have a common value in both header and detail, in the other, there is no linking value, just the positional reference in the original text file.

    As I said, I'm sure this is an old chestnut, but sorry, cannot find an answer in the forums!
    Thanks in advance,
    Peter

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

    Default

    You can't zip them back together as header and detail don't have a common format. Question is how do you want to process the records... headers in one table, detail in another, ...

    Regards,
    Sven

  3. #3

    Default

    Hi Sven,
    Sorry, was not too clear there! I need to output the data (after manipulation) back into another file in sequence.

    If I got H1, D1, D2, D3, H2, D4, D5, H3, D6, I use two TextInputs, each matched to the format desired, I do my alterations, how do then put them into another file in sequence, i.e. Hx1, Dx1, Dx2, Dx3, Hx2, Dx4, Dx5, Hx3, Dx6?
    Thanks again!
    Peter

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

    Default

    Keep the input row number in the rows. Afer you've done you're manipulation convert all fields of a row to 1 single big field (keeping rownumber separate), combine the 2 streams with a dummy, sort on rownumber and output.

    It's a bit of trick as you can't combine rows of different layout.

    Regards,
    Sven

  5. #5
    Join Date
    Jun 2007
    Posts
    138

    Default Similar problem

    Please look into this one..Near about same case.

    http://forums.pentaho.org/showthread...ghlight=HEADER

    Can javascript help here?


    Eagrly waiting for the Reply...
    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.