Equal Amount of Spaces Between Columns

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
stephane
Posts: 2
Joined: Wed Jan 23, 2008 6:57 pm
Location: Toronto

Equal Amount of Spaces Between Columns

Post by stephane »

Hello, I have a file with (5) columns.

I need to have 2 spaces separating the first 4 columns *except* when the first column has only 11 characters, in this case I need 3 spaces separating the 1st two columns.

When the first column has 12 characters reg. 2 spaces is required.

A correct example below:


1FTNE24W96D 112007 ON R 1
1FTNFR21597E 112007 ON R 1
1FTNE24W46D 112007 ON R 1
1FTNE24W96D 112007 ON R 1
1FTNFR21597E 112007 ON R 1
1FTNFR21598E 112007 ON R 1


Is there an easy way for me to do this?
Thank you
Stephane T.O
stephane
User avatar
Alan-LB
Posts: 22
Joined: Sat Feb 02, 2008 4:29 am
Location: Junee, NSW, Australia

Post by Alan-LB »

Set tabs to where you want the first character of each column to appear. Select Soft Tabs so that spaces are used instead of the Tab character.

Configure > Preferences > Document Classes > Tabulation

Then use the Tab key at the end of input of each column of data.

If the visual layout is important use a monospace font such as Courier.

Configure > Preferences > Document Classes > Font
(In Document Classes select the Document Type you are using - eg TXT, JAVA, HTML or whatever.)

Alan.
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Search for: ^(.{11}_)([0-9])
Replace with: \1_\2
--------------------------------

Use the following settings:
-----------------------------------------
[X] Regular expression
Replace All
-----------------------------------------
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
-----------------------------------------

Replace _ with space character
Hope this was helpful.............good luck,
Bob
Post Reply