maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   General (https://talk.maemo.org/forumdisplay.php?f=7)
-   -   Suggest a text editor for xml files that supports wildcard find and replace (https://talk.maemo.org/showthread.php?t=31584)

Fionn 2009-09-12 12:43

Suggest a text editor for xml files that supports wildcard find and replace
 
The title pretty much says it all.

I'm trying to import gpx maps into maemo mapper using a combination of plotting routes on the likes of Gmap Pedometer and Bike Route Toaster and then using GMapToGPX to convert the results into gpx files.

I then edit the resulting gpx file to rename element names to more maemo-mapper friendly element names.
So <rte> becomes <trk> and <rtept> becomes <trkpt> using a simple find and replace in any text editor.

Unwanted <ele>0</ele> nodes are stripped out again using a find and replace.

However I'm left with a load of <name> Turn # </name> nodes where # is a number starting with 1 and goes on sequentially.
If there's a lot of turns it's painful to delete them manually.

Hence my requirement for a text editor that supports wildcard find and replace.

nowave7 2009-09-12 12:49

Re: Suggest a text editor for xml files that supports wildcard find and replace
 
Sed, and awk, and grep come to mind in a bash script... Of course regular expressions are obligatory.

Fionn 2009-09-12 13:01

Re: Suggest a text editor for xml files that supports wildcard find and replace
 
Learning regular expressions is more effort that I'm prepared to put in for this though. It's a bit like using a sledgehammer to open a peanut from my perspective.
Of course you're right in that it would be an ideal tool for what I'm trying to do but the learning curve seems steep and off-putting at the moment for me.

texaslabrat 2009-09-12 13:03

Re: Suggest a text editor for xml files that supports wildcard find and replace
 
running on what OS?

Fionn 2009-09-12 13:06

Re: Suggest a text editor for xml files that supports wildcard find and replace
 
Quote:

Originally Posted by texaslabrat (Post 325797)
running on what OS?

XP, Mac OS X 10.4 (Tiger) or Xubuntu :).

texaslabrat 2009-09-12 13:07

Re: Suggest a text editor for xml files that supports wildcard find and replace
 
for XP, I'd suggest notepad++.

texaslabrat 2009-09-12 13:09

Re: Suggest a text editor for xml files that supports wildcard find and replace
 
Jedit is pretty powerful as well, and is cross-platform. I prefer notepad++ though personally.

nowave7 2009-09-12 13:19

Re: Suggest a text editor for xml files that supports wildcard find and replace
 
Not sure as notepad++ could do this (it could using regex, but no regex allowed :)). M$ Word has an option to find wildcards, so if you have that on Win or OS X you could try that if you dont want to learn regex.

Fionn 2009-09-12 13:24

Re: Suggest a text editor for xml files that supports wildcard find and replace
 
Quote:

Originally Posted by nowave7 (Post 325803)
Not sure as notepad++ could do this (it could using regex, but no regex allowed :)). M$ Word has an option to find wildcards, so if you have that on Win or OS X you could try that if you dont want to learn regex.

I tried the M$ Word route but it only opened the data and not the full gpx file (using Word 2003).

It's looking like I'm gonna have to bite the bullet on the regex if I want to crack this.
Unfortunately regex is looking a bit like Mandarin to me at the moment :(. Guess I'll just have to persevere. How hard can it be.

Fionn 2009-09-12 14:00

Re: Suggest a text editor for xml files that supports wildcard find and replace
 
Quote:

Originally Posted by Fionn (Post 325805)
How hard can it be.

Seemingly not that hard at all :D.

http://i28.tinypic.com/n2kf7m.png

Thanks for the help and pointers :).


All times are GMT. The time now is 15:52.

vBulletin® Version 3.8.8