Page 1 of 1

Equal Amount of Spaces Between Columns

Posted: Wed Feb 06, 2008 1:27 am
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

Posted: Wed Feb 06, 2008 2:05 am
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.

Posted: Wed Feb 06, 2008 3:18 am
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