Question for "JoinLines" Strg+J

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
Vauh
Posts: 5
Joined: Fri Dec 07, 2007 10:17 pm

Question for "JoinLines" Strg+J

Post by Vauh »

Hi,

This command is very nice, but I need to join about 20.000 lines.

Example from the original database:

1 05001U 71013 C 72043.03644156 .02468084 +00000-0 +00000-0 0 01818
2 05001 074.0714 068.6667 0031229 291.6859 068.1002 16.00211680054996
1 05002U 71013 D 72015.41588749 .03920269 +00000-0 +00000-0 0 01713
2 05002 074.0680 123.4749 0075890 346.2974 013.6157 16.15755987050774

Every line with number 2 should be joined to Number 1. but for the full database with 20.000 lines.


When finished, I wish to have only 10.000 lines, like:

1 05001U 71013 C 72043.03644156 .02468084 +00000-0 +00000-0 0 01818 2 05001 074.0714 068.6667 0031229 291.6859 068.1002 16.00211680054996


1 05002U 71013 D 72015.41588749 .03920269 +00000-0 +00000-0 0 01713 2 05002 074.0680 123.4749 0075890 346.2974 013.6157 16.15755987050774


.... and so on.....


Thanks in advance.

Vauh
User avatar
helios
Posts: 711
Joined: Sun Mar 02, 2003 5:52 pm
Location: Helios Software Solutions
Contact:

Post by helios »

Please try implementing the following procedure in TextPad:

1. Open the Replace dialog box
2. Type "(^1.+)\n" without the quotes into the "Find what"
section
3. Type "\1 " without the quotes into the "Replace with" section(Note the space after \1)
4. Under the heading "Conditions", check "Text and Regular expression"
5. Ensure the curser is at the beginning of the document
6. Click Replace All

I have used POSIX regular expression syntax, which can be selected from the Editor page of the Preferences dialog box.

I hope this helps.
Helios Software Solutions
Vauh
Posts: 5
Joined: Fri Dec 07, 2007 10:17 pm

Post by Vauh »

Thank for the message, but unfortunately I get a reply

Cannot find regular expression:
(^1.+)\n


I used search and replace from the menu.

Vauh
User avatar
helios
Posts: 711
Joined: Sun Mar 02, 2003 5:52 pm
Location: Helios Software Solutions
Contact:

Post by helios »

I have used POSIX regular expression syntax, which can be selected from the Editor page of the Preferences dialog box.
Check that POSIX is enabled.
Helios Software Solutions
Vauh
Posts: 5
Joined: Fri Dec 07, 2007 10:17 pm

Post by Vauh »

Sorry, Helios, my fault.

Thank you very much for your help.
It works fine.

Vauh
Post Reply