# How can I decrease number of lines of code in a notebook? [closed]

I have too many lines of code and I want to reduce the line count.

For example, I have a notebook with 2000 lines of code, and i want to hide some of it so there are less than, say, 200 lines. Can I put some of the code in somewhere else and then use it in my main code?

-
–  Yves Klett Apr 30 '13 at 8:17
You can insert a few section headers (using the Format/Style menu). If you double click on the cell bracket belonging to a header any code between that header and the next one will be hidden. –  Sjoerd C. de Vries Apr 30 '13 at 17:54

## closed as too localized by m_goldberg, István Zachar, Silvia, Yves Klett, Sjoerd C. de VriesApr 30 '13 at 17:55

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

One way is to put some of the code in a separate file, and then execute the code in the file using <<. This is the function Get which "reads in a file, evaluating each expression in it and returning the last one."
@david, try a=2+3 and then evaluate a in the notebook. –  user21 Apr 30 '13 at 9:46
David's point is that if you put 2+3 in the test file and it executes it, you have no way of accessing the results of the calculation. If you set a=2+3 then when you check after the Get, the value of a will be set. –  bill s Apr 30 '13 at 9:57