Before I have to paying someone to get me out of a jam, I was told that perhaps a TextPad power-user may be able to help me out....
I have a GIS file (a small portion is shown below) that I need to get into standard X Y Z format... ("LAT" "LONG" "Zvalue"). Most of the data in the INPUT file is not needed. All I need to just to extract each "LAT" & "LONG" value, and the "Zvalue" found on the line following the LAT-LONG line.
For example the Output for the below Input would be:
2917.079139 09624.825405 47836.218
2917.079146 09624.825370 47836.779
INPUT FILE:
21 $GPGGA,165121.00,2917.079139,N,09624.825405,W,2,09,0.9,34.49,M,-22.97,M,8.6,0100*4A 17:38:29.01 01/13/29
0 0.000 47836.218 17:38:29.-99 01/13/29 0
0 0.000 47836.063 17:38:29.-199 01/13/29 0
0 0.000 47836.114 17:38:29.-299 01/13/29 0
0 0.000 47836.301 17:38:29.-399 01/13/29 0
0 0.000 47836.222 17:38:29.-499 01/13/29 0
0 0.000 47835.998 17:38:29.-599 01/13/29 0
0 0.000 47836.110 17:38:29.-699 01/13/29 0
0 0.000 47836.027 17:38:29.-799 01/13/29 0
0 0.000 47836.525 17:38:29.-899 01/13/29 0
21 $GPGSA,A,3,01,05,18,14,15,11,22,25,30,,,,1.7,0.9,1.5*31 17:38:28.01 01/13/29
0 0.000 47836.826 17:38:28.01 01/13/29 0
21 $GPGGA,165120.00,2917.079146,N,09624.825370,W,2,09,0.9,34.46,M,-22.97,M,7.6,0100*46 17:38:28.01 01/13/29
0 0.000 47836.779 17:38:28.-99 01/13/29 0
0 0.000 47836.418 17:38:28.-199 01/13/29 0
0 0.000 47836.157 17:38:28.-299 01/13/29 0
0 0.000 47836.128 17:38:28.-399 01/13/29 0
0 0.000 47835.828 17:38:28.-499 01/13/29 0
0 0.000 47835.611 17:38:28.-599 01/13/29 0
0 0.000 47835.284 17:38:28.-699 01/13/29 0
0 0.000 47835.378 17:38:28.-799 01/13/29 0
0 0.000 47835.185 17:38:28.-899 01/13/29 0
21 $GPGSA,A,3,01,05,18,14,15,11,22,25,30,,,,1.7,0.9,1.5*31 17:38:27.01 01/13/29
0 0.000 47826.648 17:38:27.01 01/13/29 0
Any help would be appreciated!
Rob Kerian
Too tough for this new user... Any suggestions?
Moderators: AmigoJack, bbadmin, helios, MudGuard
-
rkerian
- Posts: 1
- Joined: Fri Feb 29, 2008 8:05 pm
- Location: Dallas TX
- MudGuard
- Posts: 1295
- Joined: Sun Mar 02, 2003 10:15 pm
- Location: Munich, Germany
- Contact:
I have a two-step solution.
First, do a replacement (Posix Syntax enabled), replace
by
Second, replace by nothing
First, do a replacement (Posix Syntax enabled), replace
Code: Select all
.*GPGGA,[^,]+,([^,]+,).,([^,]+,).*\n0 [0-9.]+([^,]+).*Code: Select all
\1\2\3Code: Select all
(0|21) .*\n- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
Here is another solution:
Combine both lines to be used:
1. Search for ^(21.{29},N,.*)\n(.*)\n
Replace with \1~\2\n
2. Delete lines not to be used
Find ^.{80,} and Mark All
Invert the Tags (Search/Invert All Bookmarks)
Delete all lines not tagged (Edit/Delete/Bookmarked lines_
3. Remove unwanted characters
Search for:
^21.{18}(.{11}),N,(.{12}).*~.{8}(.{9}).*
Replace with:
\1,\2,\3
This can also be automated and saved as a macro for repeated use.
Example above is untested, don't have access to TextPad right now.
Combine both lines to be used:
1. Search for ^(21.{29},N,.*)\n(.*)\n
Replace with \1~\2\n
2. Delete lines not to be used
Find ^.{80,} and Mark All
Invert the Tags (Search/Invert All Bookmarks)
Delete all lines not tagged (Edit/Delete/Bookmarked lines_
3. Remove unwanted characters
Search for:
^21.{18}(.{11}),N,(.{12}).*~.{8}(.{9}).*
Replace with:
\1,\2,\3
This can also be automated and saved as a macro for repeated use.
Example above is untested, don't have access to TextPad right now.
Hope this was helpful.............good luck,
Bob
Bob