separate text into column

General questions about using TextPad

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

Post Reply
FreeToLie
Posts: 2
Joined: Sat Apr 12, 2008 3:18 am

separate text into column

Post by FreeToLie »

new to textpad.

can i separate text into columns using textpad? For example, separate "text/to/column" using / as a delimiter.
drefty
Posts: 35
Joined: Mon Dec 22, 2003 3:53 pm

Post by drefty »

Yes, you can do that, although it is not entirely clear what you mean by "columns".

If you are simply asking how to change the slash character into spaces or tabs, you can select the text you want to convert, and then use the find and replace feature.

(see How to Replace Text in TP help)

Since TextPad is just a text editor (not a spreadsheet or database) you'll have to clarify what you mean by "columns" if that answer was not specific enough for your requirements.
FreeToLie
Posts: 2
Joined: Sat Apr 12, 2008 3:18 am

Post by FreeToLie »

drefty wrote:Yes, you can do that, although it is not entirely clear what you mean by "columns".

If you are simply asking how to change the slash character into spaces or tabs, you can select the text you want to convert, and then use the find and replace feature.

(see How to Replace Text in TP help)

Since TextPad is just a text editor (not a spreadsheet or database) you'll have to clarify what you mean by "columns" if that answer was not specific enough for your requirements.
What I mean by columns is I want to separate text into a neat alignment so I can block select whichever column for editing purposes.

For example i have these lines of uneven length:
C:\TEMP\1\new1
C:\TEMP\000199\new2

By replacing "" with space or TAB, the text will not align properly, correct? I want to block select the third level folders and edit the names.

Yes, Excel has a tool for "text to columns" but I'd rather use Textpad if there's a simple way to do this.
drefty
Posts: 35
Joined: Mon Dec 22, 2003 3:53 pm

Post by drefty »

I understand. As far as I know, there is no built-in easy way to do this in textpad. This is something that can be done, but from what I've seen, people usually resort to external scripts such as those written in Ruby, Javascript, Perl, Python and so forth.

If you are familiar with perl, someone has written a script that does what you are asking for, the link is here:

http://forums.textpad.com/viewtopic.php?t=4890&start=15

I'm sure there are a million other such things out there if you feel like searching around a bit.

If you are not familiar with perl, and you're not into writing a script of some sort, you'd probably be best off with excel or open office or some such thing.
User avatar
Bob Hansen
Posts: 1517
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

This may get you started.....may need to adjust for paths that are much shorter or longer....

Search for: ^(.*\\)(.*)
Replace with: \1\t\t\t\2

May be able to get better control by making tab spacing very large, and using fewer "\t" in the replacement section.
Hope this was helpful.............good luck,
Bob
Post Reply