Can line numbers be copied

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
dmaggian
Posts: 1
Joined: Fri Feb 24, 2006 9:46 pm

Can line numbers be copied

Post by dmaggian »

I need to reference line numbers when documenting some source code. I'd like to turn line numbers on in TextPad and then copy the text, including the line numbers, and paste it into my other publishing tool. Can this be done? I've searched the forums and the options but don't see a way to do it.
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Two quick possibilies:

1. You can set up printing to include numbers.
Then print to a file.

2. You can insert numbers at front of each line.
Use Column Select Mode, then Edit, Fill Block.
Hope this was helpful.............good luck,
Bob
I Steal Toast
Posts: 14
Joined: Wed Feb 02, 2005 3:05 am
Location: Why do you want to know? <_< >_>
Contact:

Post by I Steal Toast »

Some programming languages are able to insert the line number into the code. For example in C, if you write printf("%d\n",__LINE__");, with most compilers it will print the line number the statement is on.
I stole your toast.
bveldkamp

Post by bveldkamp »

And yet another possibility, if you have grep:

Code: Select all

grep -n ^ <filename>
This can be installed as a tool in Textpad.
Post Reply