循环文件的问题

ripkarsripkars MemberPosts:4Contributor I
edited June 2019 inHelp
Hello everybody

I'm willing to write a process whose aim is reading all csv files from a directory and perform the very same operation on them.

I have this problem with the Loop Files operator and its subprocess.

The Loop operator looks like this
Loop [Filter: '*.csv', Directory: /home/riccardo/Workspace/unrealtournament3-dmtm2010/Training Data, File Name Macro: file_name File Path Macro: file_path etc] (the directory is made of two parts....could it be a problem? I also tried to rename it to Training_Data but hadn't got any success ... )

Inside it I have put a Read CSV operator where the File Name is set to %{file_path} (and another operator just for the sake of connecting the output somewhere).

The error I get is:
Cannot create example set meta data: Could not read file 'null': /home/riccardo/file_path (No such file or directory)..

Shouldn't RapidMiner set the value at runtime for each of the CSV file in that directory?

Why is this process broken??

(Please answer me asap as I need to finish this work by today, 23:59 UTC +01:00)

Answers

  • ripkarsripkars MemberPosts:4Contributor I
    I try to write the same file to xrff format....not working





























  • haddockhaddock MemberPosts:849Maven
    Hi there,

    The devil is always in the detail, it was the regex '*.csv' in this case . The following logs my files..


























    <连接from_port = " 1 " to_op = "提供宏观Log Value" to_port="through 1"/>











    So now you have time for a splendid dinner as well!

    Ciao.
  • ripkarsripkars MemberPosts:4Contributor I
    Thank you very much for your interest! Now it works!
  • haddockhaddock MemberPosts:849Maven
    不错的one! Have fun..
  • cherokeecherokee MemberPosts:82Guru
    Hi!

    haddock, your solution is as always correct (and fast). Nevertheless I'm a bit confused. Of course the regexp "*.csv" does not express what is intended but isn't it also not well-formed. The star at the beginning is the problem; what is to be present zero or more times? Shouldn't there be some kind of MalformedRegExpException (I'm not shure of the correct name right now)?

    Best regards,
    chero
  • haddockhaddock MemberPosts:849Maven
    Greets Chero,

    As I see it*.csvwould choke the parrot, because, as you say, * has to follow what it can repeat, but'*.csv'( notice the single quotes ) would not. I use RegexBuddy for all this regex stuff ( brill ), about which I understand zippo!

    Ciao!

  • cherokeecherokee MemberPosts:82Guru
    Hi haddock,

    of course you are right. I missed the single quotes :-[

    Best regards,
    chero
  • cthielcthiel MemberPosts:16Maven
    ripkars wrote:

    The error I get is:
    Cannot create example set meta data: Could not read file 'null': /home/riccardo/file_path (No such file or directory)..

    Shouldn't RapidMiner set the value at runtime for each of the CSV file in that directory?
    Coming back to the original post: why does RM not replace the name of the macro with the content?

    I'm running into this issue in plenty of places, see thread at
    http://rapid-i.com/rapidforum/index.php/topic,2304.0.html

    Oddly, my processes all function, but I get plenty of "Cannot create example set meta data".

    Debugging this error class since 5+ hours... Any help would be appreciated!

    Christian
  • landland RapidMiner Certified Analyst, RapidMiner Certified Expert, MemberPosts:2531年Unicorn
    Hi,
    as I already wrote in another thread: Macros are only evaluated during run time, because they are assigned only by the execution of the respective operators. Unfortunately their value simply can't be known during execution time! Hence they can't be replaced with their values during meta data transformation and this might result in errors.
    You can't solve anything without taking a look at the actual data...

    Greetings,
    Sebastian
Sign InorRegisterto comment.