Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: Text Output Format (Datetime, Hour)

  1. #1

    Default Text Output Format (Datetime, Hour)

    Hi guys,

    I need to format a text archive to show it like this:

    LogEV_20070730_151153.txt

    With kettle automatically I generate the name, but I can not edit the format of the date or hour.

    For example: LogEV_070730_151153.txt

    The only difference is that my neccesities need to show the year complete (2007), and kettle only shows the last two digits (07), when constructing the file name.

    Is there a way to manually or tweak kettle to modify this?

    ANy advice,

    Regards,

    Ben



  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    It's hardcoded, but maybe it's a bug... I have to think on it.

    Regards,
    Sven
    Last edited by sboden; 07-30-2007 at 04:54 PM.

  3. #3

    Default Text File Output Reply

    Sven,

    Thanks for your reply,

    Do you know aprox. when will it be fixed?

    Regards,

    Ben

  4. #4
    Join Date
    May 2006
    Posts
    4,882

    Default

    In the format there are now 3 y's for the year... so either someone meant to type 2 or 4... 3 seems odd.

    Personally I would have chosen 4, but if we now change it to 4 we change existing behaviour... so it's one of those stupid little decisions with maybe a "big" impact. An extra switch: 4 or 2 digits years, ... don't know yet.

    Regards,
    Sven

  5. #5
    Join Date
    Jul 2007
    Posts
    247

    Default

    As a workaround you could define a variable which contains your date-time string and use this one as a prefix to your filename...

    See attached job and transformations for a quick and easy approach, you could even try to set and use the variable in the same transformation, but I didn't test that... If you are trying to do so, you would have to change the scope of the variable of course.

    Regards,
    Ben
    Attached Files Attached Files

  6. #6

    Default Text Output Format (Datetime, Hour) Reply to Thread

    Hi,

    Thanks for your reply and suggestion.

    I have tried your approach and found that it works if the text file output is the next step (in a transformation) or the next step (in a job).

    I have a Table Input that sends the input to the text file. When I use your approach the value of the variable ${DATE_TIME} does not pass to the text file.


    Any advice?

    Regards,

    Ben

  7. #7
    Join Date
    May 2006
    Posts
    4,882

    Default

    Variables need to be set in a different transformation than the one you use them in.

    Regards,
    Sven

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.