Hitachi Vantara Pentaho Community Forums
Results 1 to 9 of 9

Thread: Text file input cannot process attached file

  1. #1
    Join Date
    Sep 2011
    Posts
    171

    Default Text file input cannot process attached file

    Hello everyone,

    I attached both transformation and .csv file. Somehow "Text file input" component cannot read this file. When I click preview rows I get empty rows, but I am able to see file content.

    Any suggestions.


    One more question. I tried to process all files in particular folder (all files there are .csv), but realized that "CSV file input component" does not have this capability, so I switch to "Text file component". I guess I will need to use Regexp. Do you think "*.*" would work in my case?

    Regards,
    Alex

    P.S. I had to put .csv file into .rar archive. Why .csv are not allowed as attachements?
    Attached Files Attached Files

  2. #2
    Join Date
    Nov 2008
    Posts
    271

    Default

    You have to do a "Get Fields" or type fields name in "Fields" tab.
    Andrea Torre
    twitter: @andtorg

    join the community on ##pentaho - a freenode irc channel

  3. #3
    Join Date
    Apr 2008
    Posts
    1,771

    Default

    To get all your files ina folder using a regexp *.* does not work.
    It is a Windows/DOS expression.

    Try: .*.csv

    Mick.

  4. #4
    Join Date
    Nov 2008
    Posts
    271

    Default

    Hi Mick,
    just a word of caution here.
    Of course it depends on what kind of match you need, but a regex .*.csv matches also a file with name " csv", i.d. without extension and with a space before csv. If you need to consider the dot as a separator between name and extension you should escape it as in .*\.csv
    Also consider that the * is a greedy that matches 0 or more times. Not a problem in this case because you cannot have a file that starts with the dot, but if you need to match a string with at least a character I would suggest the + that matches 1 or more times.

    Cheers
    Andrea Torre
    twitter: @andtorg

    join the community on ##pentaho - a freenode irc channel

  5. #5
    Join Date
    Sep 2011
    Posts
    171

    Default

    Hi Andrea,

    Since regexp in Pentaho are different from regular regexp, I wonder where I can find a summary of the differences?

    Regards,
    Alex

  6. #6
    Join Date
    Apr 2007
    Posts
    2,010

    Default

    eh what? they're standard java regex. Not sure what you mean by different! So read the java docs to find out what you can and cannot do.

    regex are a bit like sql - there's a "standard" but no 2 implementations are the same!

  7. #7
    Join Date
    Nov 2008
    Posts
    271

    Default

    What do you mean with "regular regexp"? Are you referring to another flavour of sintax?
    I think that the bulk is the same among all versions, but if you want to dive into the subject, I can suggest to look into java.util.regex package, that pdi uses to manage the stuff.

    Maybe you can find useful to give a look at some tutorials as well. This is a robust starting point.

    Cheers
    Andrea Torre
    twitter: @andtorg

    join the community on ##pentaho - a freenode irc channel

  8. #8
    Join Date
    Sep 2011
    Posts
    171

    Default

    Thank you!

    Yeap, I meant different syntax.

  9. #9
    Join Date
    Apr 2007
    Posts
    2,010

    Default

    and dont forget slawo's blog. he's got some great bits on regex in pdi.

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.