Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Read file into a field

  1. #1
    Join Date
    Nov 2009
    Posts
    11

    Default Read file into a field

    Hi,

    I want to read all the contents of a local file (it's a loose html file in filename.txt plain text format) into a field or column. The final purpose is to store the contents of the file in a database column and also to clean up the HTML at a later point. I cannot use Web Client as the file is not on any web server.

    How can I achieve the above? I looked on Google and this forum and could not find anything. May be I am not using the correct keywords. Any pointer will help me. I'm using PDI 4 RC1.

    Thanks.
    Sean

  2. #2
    Join Date
    Aug 2010
    Posts
    12

    Default

    1. use text file input step
    2. use concatenate lines step

  3. #3
    Join Date
    Sep 2011
    Posts
    1

    Lightbulb

    Hi psm2000,

    You can use the "Load file content into memory" step to accomplish this. By using this step , you can load the File contents, File size and any other relevant fields (like path, file name, etc.) in to separate fields in your transformation.
    I've supplied a very simple sample transformation and HTML-file to show you how this can be accomplished.

    Best Regards
    Andreas Wikell
    Netlight Consulting AB
    Attached Files Attached Files

  4. #4
    Join Date
    Nov 2009
    Posts
    11

    Post

    Andreas,
    Thank you for pointing me to the correct input step. I tried the sample and it is going to work well for my needs.

    framaba,
    The other idea about concatenation will not work for my situation as I need to keep the newline characters etc. intact.

    Thank you!
    Sean

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.