![]() |
#1
|
|||
|
|||
![]()
I've got this document with thousand of line of coordinates points like that :
166.367255491767 -22.3247832117284 166.367461004327 -22.3248066556704 I want to change the format and like, as a result, something like that : [-22.3247832117284,166.367255491767] [-22.3248066556704,166.367461004327] Do you know a way to do so, automatically with Microsoft Word ? Thanks, |
#2
|
||||
|
||||
![]()
A macro isn't necessary. Replace
([0-9]{3}.[0-9]{12}) (-[0-9]{2}.[0-9]{13}) with [\2,\1] with the wildcard option set. http://www.gmayor.com/replace_using_wildcards.htm
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
||||
|
||||
![]()
Lat/Lon coordinates (which is what these appear to be) can be negative on either side and span +/- 0-179.9999999999999 degrees. Your coordinates also appear to be limited to a 15-digit precision, so the more digits you have for the integer part, the less you have for the decimal part. Given those parameters, your wildcard Find/Replace expression should probably be:
Find = ([\-0-9.]{16,17}) ([\-0-9.]{16,17}) Replace = [\2,\1] Note: I've assumed your coordinates have trailing 0s
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#4
|
|||
|
|||
![]()
Both right ! Thank you for the answers ! Working great !
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Steve81uk | Excel | 23 | 05-17-2025 03:22 PM |
![]() |
Deltaj | Word VBA | 2 | 12-04-2014 02:13 PM |
How to parse bold sections of a paragraph? | XmisterIS | Word VBA | 2 | 03-31-2014 02:54 PM |
![]() |
MaxInCO | Word VBA | 5 | 12-11-2013 03:28 PM |
parse, store and email a .tmp file from wordpad? | scadaman29325 | Office | 0 | 09-28-2010 04:56 PM |