Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: Renaming a .csv File

  1. #1
    Join Date
    Aug 2014
    Posts
    4

    Default Renaming a .csv File

    Hi,

    I could do with some help on the below!

    I need to change a filename before uploading the file onto an FTP. The step that are needed are:

    Get Mail (POP3/IMAP) ---> Rename File ------> Put a file with FTP

    I am able to do the first and last step. However I have been unsuccessful in my attempts to alter the name of the file that has been extracted from the email.

    The file name need to be distinguished by adding 'Weekly Report' into the filename.

    Is there a way that this could be done?

    Thanks!

  2. #2
    Join Date
    Nov 2009
    Posts
    687

    Default

    You can rename a file with the "Copy Files" or "Move Files" step

  3. #3
    Join Date
    Aug 2014
    Posts
    4

    Default

    Hi,

    Thanks for your response.

    I have tried with those step but have been unsuccessful. I have only managed to add the date to the file name using the 'move file' step.

    The file is taken from an email in the format REF_Data_mmYY.csv and I need to add text to the end of the file name to distinguish the weekly file. The desired outcome would be to edit it so that it was as follows: REF_Data_mmYY_WeeklyFile.csv.

    Is this still possible with the "Copy Files" or "Move Files" step? If so which field would I need to edit to achieve this?

    Thank you!

  4. #4
    Join Date
    Nov 2009
    Posts
    687

    Default

    Name:  Capture.jpg
Views: 37
Size:  20.7 KB

    The variable NameFile is the name and place from the file

  5. #5
    Join Date
    Aug 2014
    Posts
    4

    Default

    Name:  pentaho.jpg
Views: 37
Size:  21.9 KB

    Hi,

    Great thank you for providing that information. I have successfully managed to rename the file.

    However, I still have a problem that the file name is not static, each week the file name will change, the file will have a different number at the start and the month will change.

    Is it possible to make the 'File/Folder Source' reference flexible? So that it would take whatever file name that is stored within the folder and add _weekly report to that file?

    The Source is below: 4567816_Consumption_Aug14 this will change each week

    C:\CCES Files\Pentaho Files\Client Weekly\4567816_Consumption_Aug14.csv

    Thanks!

  6. #6
    Join Date
    Nov 2009
    Posts
    687

    Default

    - Make a transformation whith the step "Get File Names". Set your variable with the result of the filename
    - Use that variable in your job

  7. #7
    Join Date
    Aug 2014
    Posts
    4

    Default

    Is there a way of making this step link with the job so that is fully automated?

    I assume that with this step I would have to manually run the transformation first? And then use that result and paste the link into my Job?

Tags for this Thread

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.