splitting to sublist - HELLPPPP
- Posted by begin May 29, 2018
- 1383 views
Hi, I have a problem that I some can not solve, left alone elegantly. I hope some in the forum has some code that will solve the task. I have for ex.:
{{1000,90},{1000,90},{1000,90},{1002,70},{1000,90},{1000,90},{1002,70}} {{1000,90},{1000,90},{1000,90},{1000,70},{1000,90},{1000,90},{1000,70}} {{1000,90},{1002,90},{1002,90},{1002,70},{1002,90},{1002,90},{1002,70}}
where
1000 = and 1002 = or
the other numbers are a cf's, between 1 and 100 The first item in the list will always be an and (1000). The list can be unlimited long. It can consist of all and’s or the first and and followed by all or’s. usually the list is dispersed with or’s.
The list has to be restructured to a new list with sublists for ex.
{{1000,90},{1002,80},{1002,90},{1002,90},{1002,90},{1002,80},{1002,90},{1002,90},{1002,80}} {{1000,90},{1000,80},{1000,90},{1000,90},{1000,90},{1000,80},{1000,90},{1000,90},{1000,80}} {{1000,90},{1002,80}}, {1000,90}, {{1000,90},{1002,80}}, {1000,90}, {{1000,90},{1002,80}} {{1000,90},{1002,80},{1002,90},{1002,90}} {{1000,90},{1002,80}}, {1000,90}, {{1000,90},{1002,80}}
anybody an idea or even some code? thanks in advance