Options

Loop Excel file and write for each cell a text document

limegreenman900limegreenman900 Member Posts: 26 Contributor II
edited November 2018 in Help

Hi everyone,

 

I am stuck with a hopefully pretty easy problem. I am using "Process Documents from files" operator and within it a "Cut Document" operator. What I want to do, is to extract a specific section out of my input documents. Is there any chance, I am thinking of a loop operator, to get for each input file an according output file (in txt or csv) that only contains the result of my "Cut Document" operator (not mandatory but nice: if the output files could have the same file names as the input files)? Up until now I use "write excel" but this gives me only a single excel file containing all outputs....

 

Any help appreciated.

Best Answer

  • Options
    bhupendra_patilbhupendra_patil Administrator, Employee, Member Posts: 168 RM Data Scientist
    Solution Accepted

    When using PRocess documents from files you can check the "add meta information checkbox. Then it will automatically add a new column to the output example set called as metadata_file that will get you the file name. There is also complete path variable. See the attached process, You will need to modify it to point to your directory and cut logic.

    But then I am setting up a macro and then saving with the macro in file path

     

Answers

  • Options
    MartinLiebigMartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,524 RM Data Scientist

    Hi,

     

    If you use loop files and process documents you could use the given file_name macro to do this.

     

    ~Martin

    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
  • Options
    limegreenman900limegreenman900 Member Posts: 26 Contributor II

    @bhupendra_patil: Works perfectly! Thanks for this uncomplicated and neat solution!

Sign In or Register to comment.