I have merged cells in a Notebook
file.
Is there a way to split such a merged cell group back to single cells, in each of them being one command?
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityI have merged cells in a Notebook
file.
Is there a way to split such a merged cell group back to single cells, in each of them being one command?
Put this code after your merged cell and evaluate, it should print below all expressions separately.
I don't know how solid it is but worth a try:
Composition[
Scan[NotebookWrite[EvaluationNotebook[], Cell[#, "Input"]] &, #] &,
Thread,
DeleteCases[#, "\[IndentingNewLine]" | "\n", {2}] &,
First,
NotebookRead
] @ PreviousCell[]
"Input"
from the original Cell style instead to make this more robust.
$\endgroup$
Jul 1, 2015 at 7:58