i'm trying to swap latitude and longitude values in notepad++ with regular expressions. i tried to search some guide on the web but i didn't understand how to do. i have a file in which there are: "longitude,latitude" and i want to get: "latitude,longitude" in each row
Example (with two rows):
12.5164654350527,41.8919188281474
12.5164650441393,41.891919097598
becomes
41.8919188281474,12.5164654350527
41.891919097598,12.5164650441393
Which regular expression do i have to use?
Search for:
Replace with:
This catches numbers like
1
,1.1
but not1.
or.5
. My previous regexp([0-9]+.?[0-9]*),([0-9]+.?[0-9]*)
would allow for1.
.find what:
replace with:
also, search mode should be set to regular expression
edit: escaped
.
as suggested in comments.Make sure you place the cursor at the beginning of the file.
CTRL+H
.Replace
tab.Select
Regular Expression
at the bottom.Find:
([\d.]+),([\d.]+)
Replace:
\2,\1
Try with following regex:
and replace it with: