Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: TextFileInput Question

  1. #1

    Default TextFileInput Question

    I'm parsing a fixed length record file and all numeric values are defined as a number with a fixed length and precision. So for example, the file may have a numeric field with a value of 123456789 in the file, but the real value is 1234.56789 (i.e. in my case, the length can be 13 but the precision is defined to be 8.5, 99999999.99999). I was able to add a java script step that did the conversion, but this noticeably slowed the performance. The text field input step includes a format and precision definition for the field, but that doesn't seem to insert an implied decimal point. What is the best way to do this?


    Thanks,



    Rich

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

    Default RE: TextFileInput Question

    Rich,

    Use a Calculator to divide by 100000. Define a Constant with 100000 in an integer.
    Performance will be a LOT better: no scripting

    All the best,

    Matt

  3. #3

    Default RE: TextFileInput Question

    Thanks Matt, that worked. One other request that I think using the calculator might be useful. I have several fields that represent hex numbers as strings (i.e. 0x000019000000968f). Right now I'm using Java Script to convert that back to a long. Would it be possible to extend the calculator to do this as well?

    Thanks,

    Rich

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.