Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-20-2016, 10:56 PM
stephanberger4 stephanberger4 is offline Parse coordinates in Word Windows 10 Parse coordinates in Word Office 2016
Novice
Parse coordinates in Word
 
Join Date: Aug 2016
Posts: 2
stephanberger4 is on a distinguished road
Default Parse coordinates in Word

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,
Reply With Quote
  #2  
Old 08-21-2016, 02:21 AM
gmayor's Avatar
gmayor gmayor is offline Parse coordinates in Word Windows 10 Parse coordinates in Word Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,137
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
  #3  
Old 08-21-2016, 03:45 AM
macropod's Avatar
macropod macropod is online now Parse coordinates in Word Windows 7 64bit Parse coordinates in Word Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,349
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #4  
Old 08-21-2016, 02:05 PM
stephanberger4 stephanberger4 is offline Parse coordinates in Word Windows 10 Parse coordinates in Word Office 2016
Novice
Parse coordinates in Word
 
Join Date: Aug 2016
Posts: 2
stephanberger4 is on a distinguished road
Default

Both right ! Thank you for the answers ! Working great !
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Parse coordinates in Word trying to find a way to show a closest to using lat and long coordinates Steve81uk Excel 23 05-17-2025 03:22 PM
Parse coordinates in Word addpicture coordinates keep me in the first page 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
Parse coordinates in Word Calculate the coordinates of a DocVariable, Bookmark or paragraph. 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

Other Forums: Access Forums

All times are GMT -7. The time now is 12:44 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft