Add Line Numbers in a column

General questions about using TextPad

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

Post Reply
geoffrey

Add Line Numbers in a column

Post by geoffrey »

In another text editor called UltraEdit32, I am able to insert a column of numbers in a highlighted area -- i.e. like line numbers but in the document.

Is there a way to do this in TextPad?

Thanks!
Roy Beatty

Re: Add Line Numbers in a column

Post by Roy Beatty »

Adding a column of line numbers can be done by any text editor that supports Regular Expressions, including TextPad.

See http://www.textpad.com/forum/read.php?f=1&i=1321&t=1290

Hope this helps,

Roy
geoffrey

Re: Add Line Numbers in a column

Post by geoffrey »

I also found a feature...

Edit>Fill Block...

This works perfectly.
ron

Re: Numbers in a column

Post by ron »

I am trying to set-up a contact list with a group of phone numbers. I have a list of approx. 10,000 numbers without area codes in an Excel spreadsheet. How can I use Textpad to place a three digit area codes in front of each of these numbers?
Thank you,
Ron
Spudnic

Re: Numbers in a column

Post by Spudnic »

Assuming the phone numbers are the first items on a line such as:

555-2345 John Doe
555-2349 Jane Doe
555-2344 Billy Doe

You could do a search and replace, check Regular expression
Find what: ^
Replace with: (225)

This would make the list look like this:

(225) 555-2345 John Doe
(225) 555-2349 Jane Doe
(225) 555-2344 Billy Doe

If the phone number portion is not the first thing on the line like this:

Some text here 324-2345 132 Main Street
Some text here 324-2345 4563 Main Street
Some text here 324-2345 Hwy 323-4 Something
Some text here 324-2345 Rt 5 Box 234
Some text here 324-2345 Box 234 Elm Street Apt 25

You could do a search and replace, check Regular expression
Find what: [[:blank:]]\([0-9]\{3\}\-[0-9]\{4\}\)
Replace with: (225) \1

To get:

Some text here (225) 324-2345 132 Main Street
Some text here (225) 324-2345 4563 Main Street
Some text here (225) 324-2345 Hwy 323-4 Something
Some text here (225) 324-2345 Rt 5 Box 234
Some text here (225) 324-2345 Box 234 Elm Street Apt 25


Note that this regex will match any three digits, followed by a dash, and then 4 more digits. If some other number could possibly match this pattern then you need to make it a little smarter.

Good luck.
--Spudnic
Post Reply