Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: how to add column with constant number to each file

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2017

    Default how to add column with constant number to each file

    I'd like it if you could help me,
    I have a step that reads over 100 text files,
    each file contains about 15 lines
    I'd like to put a column with a constant number to identify each file,
    all this I put in a table


    file 1
    column 1 column 2
    xxxxxx ---- 1
    xxxxxx ---- 1
    xxxxxx ---- 1
    xxxxxx ---- 1

    file 2
    xxxxxx ---- 2
    xxxxxx ---- 2
    xxxxxx ---- 2

    xxxxxx ---- 3
    xxxxxx ---- 3
    xxxxxx ---- 3

    with row number by file does not work because the number is sequential, not independent for each file

    I'm sorry about my English.
    Thank you very much.

    text file imput ------> select values ----------> table output

  2. #2
    Join Date
    Nov 2009


    When you put your file name in a result column you can change the column 2 (contant number) and add 1 if the filename changed. You can do that with f.e. javascript

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.