Message Boards Message Boards

0
|
12337 Views
|
5 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Clear all notebook w/out closing & opening another?

Posted 9 years ago

Is there a way to clean all the notebook without closing it and opening another one?

Thanks!

POSTED BY: erivaldo nunes
5 Replies
Posted 8 years ago

Ctrl+A and DEL (or Backspace) works for me (in Windows). I am using the Wolfram Cloud. I also do Evaluation->ResetSession to reset the cell output numbers.

POSTED BY: steven searles
Posted 9 years ago

Programmatic solutions can be found in this thread: "How can I clear the content of my notebook in Mathematica?"

POSTED BY: Alexey Popkov

Alexey, thanks for pointing the cross-post out. Because it is on hold and can be closed in future we are riposting explicitly the answers.


Alexey Popkov

This is very efficient for large Notebooks:

NotebookPut[Notebook[{}], EvaluationNotebook[]];

(simple replacement of the evaluation notebook with blank notebook).

I have tested this method with a Notebook of size 976 Mb containing 36031 Cells and it was cleared out in no time, while the NotebookDelete[Cells[]] method seems to take forever for this Notebook!


Mr.Wizard

This will delete everything in the evaluation Notebook:

NotebookDelete[Cells[]]

This will generate a Palette Button that deletes everything is the selected Notebook:

CreatePalette @ Button["Clear Notebook", NotebookDelete @ Cells @ InputNotebook[]]

As noted in the comments it is probably just as fast, if not faster, to simply Select All and Clear (Ctrl+A and Delete in Windows).


leosenko

If you mean screen, then ctrl + A to select all cells and then hit del. If you mean memory, then ClearAll["Global`*"] if it does not help, restart...

POSTED BY: Moderation Team

Do you want to remove all the cells in the notebook?

   Edit > Select All 
   Then Delete
POSTED BY: Sean Clarke
Posted 9 years ago

Yeah buddy, thanks

POSTED BY: erivaldo nunes
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract