The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
Separating Row from CSV File with a condition
P2017000971
Member Posts: 8 Learner III
Hello Guys,
I have imported a CSV File containing different attributes and Rows
I Want to separate this file into multiple files or multiple outputs using a condition
As seen The data are merged, and I want the data which starts with runningsensor at row 1 row to be as separate output alone until row no (8).
After that the other running sensor to be separated starting with "runningsensor" again from row no (9) untill the last row before the new runningsensor row
I want it to be automatic to separate it
any feedbacks
I have imported a CSV File containing different attributes and Rows
I Want to separate this file into multiple files or multiple outputs using a condition
As seen The data are merged, and I want the data which starts with runningsensor at row 1 row to be as separate output alone until row no (8).
After that the other running sensor to be separated starting with "runningsensor" again from row no (9) untill the last row before the new runningsensor row
I want it to be automatic to separate it
any feedbacks
Tagged:
0
Answers
First copy - paste the XML inside rapidminer. In order to do so go to view -> Show Panel -> XML
This provides you the XML view of processes, paste the content in the content pane, press the green tick on the upper left corner to load it, and then move back to the process view.
Now you will be able to see the actual operators, the 'create exampleset' mimics your excel sheet and can therefore easily be replaced with your actual data.
What happens next is macro-magic, I've defined one starting value (just a zero) and then we start looping through all the examples (rows) one by one. If the value of attribute one is equal to runningsensor we increment our base macro, otherwise it remains the same. This value is used to generate a new attribute (column) so you get something like this :
start
-> macro value = 0
-key- - new attribute with macro value-
...
and so on...
This way you get 'sets' and with using the loop value operator on the new attribute you can split them accordingly.
Hope this makes it easier.
attached is the txt file i worked on. Feel free to use it to make the process as requested
Attached adjusted process, you only need to change the location to your 1.txt file
Now I am trying to use these files. How do I use these 6 files because when i am trying, i could not do anything but seeing them. thanks man
If it is not too much to ask, would u please assist me in " 'loop collection' operator, and do your logic for every example set". I tried the operator but could not get a grasp of how to do it correctly. if u can apply it on 2 example sets and show me the XML and I will learn to do the rest. Thanks a lot
The process starts with one big example set, and then splits it in a collection of smaller example sets. The loop collection operator allows you to iterate now over these one by one, so you need to apply some further logic to them. This could go from just saving them one by one as separate datasets (as in example) , or apply logic and append them all together again, and so one.
The only limitation would be your imagination