Can you please tell me how can I copy some lines of code in Notepad ++, along with its lines number ?
That is, supposed I have a code.txt opened by notepad ++ like this (numbers are displayed by using Settings --> Preferences --> Editing --> Display line number):
1 This is line 1
2 This is line 2
.
.
n This is line n
I want to copy it into a .doc / .odt file so that the line number is included in the result, NOT like this:
This is line 1
This is line 2
.
.
This is line n
You should add line number to your document opened in nodepad++. Then you copied to .doc or other files. To realize this, there may be two ways. For both two ways. Select your lines in nodepad++.
1) Use TextFX->TextFX Tools->Insert line numbers.
Instead to this, 2) To remove unnecessary leading zeros
2.1)First Left indent TextFX->TextFX Edit->Indent text sticky left margin
2.2)Add numbers Edit->Column Editors in Number to Insert
I hope this will help.
This can be done easily without using any addon if you are not strict towards the format of line no. Your file is
1 This is line 1
2 This is line 2
.
.
n This is line n
go to find, put .*
in find what
ie regular expression to look everything in a line, then click find all in current document
. You will get following in search window.
Line 1: 1 This is line 1
Line 2: 2 This is line 2
Line 3: .
Line 4: .
Line 5: n This is line n
You can copy the content of search window [right click in the search window -> select all -> copy]
and paste in another file. Of course line no is not only number but Line #:
. If it is acceptable then your work is done.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With