Hitachi Vantara Pentaho Community Forums
Results 1 to 8 of 8

Thread: Stuck: getting filename from the previous input

  1. #1

    Default Stuck: getting filename from the previous input

    Hi All,
    I have first grabbed a csv file and used "Replace string" to transform the file to ".txt" type and then changed the encoding of a file with "Change file encoding" tranformation. The new file is stored in "newfilename" output column of this transformation.

    I want to use this filename as input for the next steps. I figured out I have to use "Text file input" to grab the filename from previous step. My problem is with this field - 'Field in the input to use as filename' for which I have assigned "newfilename" because the entire path and filename of the file is in that column. But "Preview" gives me the following message "specify atleast one text sample in the file list.when reading filenames from previous steps this file will not be used."

    Please help me! Thanks!

  2. #2
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    You are changing a single file's extension from .csv to .txt and change the file encoding, before the real row and field processing starts?
    So long, and thanks for all the fish.

  3. #3

    Default

    Quote Originally Posted by marabu View Post
    You are changing a single file's extension from .csv to .txt and change the file encoding, before the real row and field processing starts?
    Yes because I want to preserve Nordic characters like -å, ä, ö before running further transformations on them.

  4. #4
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    So your transformation would actually start with a Text File Input step?
    So long, and thanks for all the fish.

  5. #5

    Default

    yes. I have checked that a textfile with utf8 encoding gets created in "change encoding" step. I just want the "Text input file" to grab this filename from "change encoding".

  6. #6
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    You don't have to prepare your input file at all, I think.
    Just use the Text File Input step and give it the original input filename.
    Set the Encoding option on the Content page of the TFI step dialog to windows-1252 or whatever you like.
    So long, and thanks for all the fish.

  7. #7

    Default

    Nope. I have checked with both csv input and txt file input and it is necessary that i do file type and encoding changes. Is it not possible to draw the file name from "change encoding" step to "text file input" step?Thanks1

  8. #8
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Sure, just enable "Accept filenames from previous step" on the first page of the TFI step dialog.
    So long, and thanks for all the fish.

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.