3
$\begingroup$

This question already has an answer here:

I have the list {7, 8, 9, 10, 11, 12, 13, 14} and would like to split it into a list of size 2, a list of size 3, and covert the remaining element into singleton lists, giving the result {{7, 8}, {9, 10, 11}, {12}, {13}, {14}}. Is there a built-in function that allows me to do this?

$\endgroup$

marked as duplicate by J. M. will be back soon Jun 18 '16 at 23:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 3
    $\begingroup$ FoldPairList[TakeDrop, {7, 8, 9, 10, 11, 12, 13, 14}, {2, 3, 1, 1, 1}] or Internal`PartitionRagged[{7, 8, 9, 10, 11, 12, 13, 14}, {2, 3, 1, 1, 1}] - usual caution re: undocumented/internal functions. $\endgroup$ – ciao Jun 18 '16 at 23:01
  • $\begingroup$ Thank you! This works perfectly! Could you tell me what is the exact action of FoldPairList? I am reading the documentation but don't really understand the explanations and the examples. Thanks! $\endgroup$ – user41106 Jun 18 '16 at 23:06
  • 1
    $\begingroup$ If the solutions in the linked question do not suit you, please edit your question to say why they don't work for you. $\endgroup$ – J. M. will be back soon Jun 18 '16 at 23:16

Browse other questions tagged or ask your own question.