Sorting csv file on 3 different node lvls using parent id
Hi there!
I'm pretty new to RapidMiner and already did the tutorials and looked for a solution for my problem in this forum as well as on google and youtube but can't figure out how i should start with.
I have a .csv table with following attributes:
id - parent_id - level
The data comes from facebook. I downloaded a post (which is level 1) with all comments (level 2) and the re-comments (level 3). Now i got a lot of unstructured data and try to find a way to sort it in the right way. I think it's easier with an example:
unstructured (how it is)
id par_id lvl
15 1 1 --> all on lvl 1 are different posts
16 1 1
21 15 2 --> on lvl 2 we have the parent_id, in this case 15. So this is a comment of the post with the id 15
22 15 2 --> this one is also a comment of post with the id 15
23 15 2
27 16 2 --> this one is a comment (because level 2!) on the post with the id 16
28 16 2
29 16 2
52 21 3 --> on level 3 we have the comment of a comment. in this case it's a comment to the comment with the id 21 (parent_id)
53 22 3 --> this one is a re-comment on the comment with the parent_id 22
54 22 3
55 22 3
56 27 3
57 27 3
So what i want is to sort them like this:
id par_id lvl
15 1 1
21 15 2
52 21 3
22 15 2
53 22 3
54 22 3
So that the post is on first position, followed by the comment and the recomment of this comment. Then there should be the next comment with the recomments. Like you know it from Facebook.
At the end it would also be very helpful if there is a possibitity to get a own document (exampleSet) for every single post (lvl 1) with the comments and recomments out of it. So for the first post with id 15, the comments and the recomments. Would need that for analysing the data...
I know, it's a lot i ask for, but i really don't have a clue how to manage that.
I hope i explained it in way to understand what i mean. I'll also add my testfile.csv if you need it in any case. Would be super gradeful if somebody could tell me how i can manage that problem! Thanks in advance
Mike