insert blank spaces to create a defined column width

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
julieg
Posts: 2
Joined: Tue Mar 06, 2012 5:14 pm

insert blank spaces to create a defined column width

Post by julieg »

I am new to Text Pad and need direction on how to add blank spaces to a column to create a defined column width. Example I have to have a column width defined at 50 characters but the longest name in that column is only 11 characters therefore when I use notepad I have to insert 39 spaces into each row of the report. Is there a way to format the column to 50 so I don't have to insert spaces in every row? Any help would be greatly appreciated.

Thanks.
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

You can do this with a regular expression replacement. You haven't told us which character position the column that's too narrow begins in. If it begins in position 1, you can use the following as it stands; otherwise you'll have to adjust the repetition value 11 as appropriate:

Use "Posix" regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax
Search | Replace... (<F8>):
Find what: ^.{11}
Replace with: \0_______________________________________ [Replace the underscores with spaces]

[X] Regular expression

Replace All
Alternatively, you can turn on block select mode (this requires you to be using a fixed-width font):
Configure | Block Select Mode
Then either copy & paste a column of one or more spaces where you need them,
or select a column at the current right-hand edge of the column that's too narrow and type <Tab>. You may need to fiddle with the tab settings to get this to work efficiently.
julieg
Posts: 2
Joined: Tue Mar 06, 2012 5:14 pm

Post by julieg »

Thanks for your help. Will try this.

Julie
Post Reply