K
K
klarabro2016-11-11 18:31:58
linux
klarabro, 2016-11-11 18:31:58

How to remove output from ipython notebook everything hangs?

I accidentally wrote the output of a huge text in my laptop, now I don’t know how to edit it. Text editors hang, even console ones. Just cat outputs, but edit how? the output is unfortunately in the middle somewhere in the script

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
ipc_ngs, 2016-11-11
@klarabro

If you know any keywords or constructions at the beginning and end of the desired fragment, you can use "grep -n" to find the corresponding line numbers and use "head -n" and "tail -n" to cut off extra pieces from the beginning and end . Only the desired fragment will remain.
If it is difficult to search for line numbers, but the location of the fragment is approximately known (for example, in the very middle of the file), you can use "dd skip=<offset> count=<size>" to bite out a piece of reasonable size from an approximate offset, and already in this small piece text editor to find the desired fragment.

S
sim3x, 2016-11-11
@sim3x

vim

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question