Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Filling out table definitions

  1. #1
    Join Date
    Oct 2007
    Posts
    235

    Default Filling out table definitions

    I have just had to deal with a table with 173 columns (Don't ask) entering all the column names into the CSV input step was a bit of a pain due to the example file not having any header.

    As far as I could tell I had Two options a) use the "Get Fields" and then go and fill out the column names manually or b) copy all the column names in and then fill out the types manually.

    In the end I went with b) and used the "Copy Field Values to all Rows" option to populate all the columns as Integers (the most common type) and then change the ones that were different.

    What I am interested in is there a better way to do this? Or due the lack of headers am I stuffed?

    Wil

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

    Default

    Well, I usually run "get fields" and then copy the result into a spreadsheet. (CTRL-A, CTRL-C in the grid)

    After editing, clear the grid and paste the information back into the grid from the spreadsheet. Make sure to include the header row in the copy/paste operation.

    At least that way you can mix the field-metadata from various sources.

    Matt

  3. #3
    Join Date
    Sep 2007
    Posts
    834

    Default

    c) Create a copy of your file, add the header - I'm supposing you have it because you use it in (b) -
    and read this file. "Get fields" will get column names and types.
    Then, just adjust the step configuration: change the name of the file by your real file, and uncheck the "header present" checkbox.
    Last edited by Maria Roldan; 06-24-2009 at 12:53 PM.

  4. #4
    Join Date
    Oct 2007
    Posts
    235

    Default

    Ah of course, so simple, thanks Matt.

    Miria that still means formatting the 174 rows into columns, only some reg-ex-fu but I think the spreadsheet idea is probably simpler.

    Thanks

    Wil

  5. #5
    Join Date
    Sep 2007
    Posts
    834

    Default

    If you have the headers as rows, you can copy them, past them "transposed" in excel or calc, and copy the transposed header to the file. It's not complicated. But you are right, Matt's solution is simpler.

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.