Page 1 of 1

Question for "JoinLines" Strg+J

Posted: Mon Aug 04, 2008 4:21 pm
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

Posted: Mon Aug 04, 2008 4:53 pm
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.

Posted: Mon Aug 04, 2008 5:57 pm
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

Posted: Mon Aug 04, 2008 7:02 pm
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.

Posted: Mon Aug 04, 2008 8:38 pm
by Vauh
Sorry, Helios, my fault.

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

Vauh