jholly Posted December 4, 2010 Share Posted December 4, 2010 I am looking for a program to generate a list of GC codes that are in a .gpx file. Yes I know GSAK can do it. But GSAK is not an option. Think simple and cheap, like in zero. A File->input, File->output is what I am looking for. I played with GPSBabel GUI a bit but did not seem to find the combination, will that work? Quote Link to comment
Motorcycle_Mama Posted December 4, 2010 Share Posted December 4, 2010 MapSource? EasyGPS? Extra POI Editor? (Save As ... CSV) Quote Link to comment
+dfx Posted December 4, 2010 Share Posted December 4, 2010 cat xxx.gpx | grep '<name>GC' | cut -d\> -f 2 | cut -d\< -f1 that good enough? Quote Link to comment
+Chrysalides Posted December 4, 2010 Share Posted December 4, 2010 You can also download Notepad++ and use regular expression search and replace if you don't mind doing it semi-manually (a few clicks and some typing and you're done). For the command line dfx suggested, you can find a Windows command line version of grep. There's also a Windows command line version of cut. You can replace the "cat | grep" with "grep '<name>GC' xxx.gpx" (or replace cat with type) - DOS piping wasn't efficient, don't know if Windows command line improved it. I don't have my usual working environment with me right now so I can't test it. Quote Link to comment
+EScout Posted December 4, 2010 Share Posted December 4, 2010 Drop the file into G7ToWin and then save it as a CSV format. G7ToWin I usually use this program as a track log utility, but it will work for waypoint files. Quote Link to comment
+dfx Posted December 4, 2010 Share Posted December 4, 2010 For the command line dfx suggested, you can find a Windows command line version of grep. There's also a Windows command line version of cut. You can replace the "cat | grep" with "grep '<name>GC' xxx.gpx" (or replace cat with type) - DOS piping wasn't efficient, don't know if Windows command line improved it. I don't have my usual working environment with me right now so I can't test it. or you can just use an old favorite of mine, cygwin Quote Link to comment
+Chrysalides Posted December 4, 2010 Share Posted December 4, 2010 or you can just use an old favorite of mine, cygwin Good if jholly (what's that avatar anyway? Cthulhu in a Santa hat?) wants to duplicate a Unix environment in Windows. For just one task seems to be overkill though Oh, I forgot to mention "unix2dos" which may be necessary to convert between Unix style line terminators and Microsoft style. Quote Link to comment
jholly Posted December 4, 2010 Author Share Posted December 4, 2010 Good if jholly (what's that avatar anyway? Cthulhu in a Santa hat?) wants to duplicate a Unix environment in Windows. For just one task seems to be overkill though The Christmas avatar is Dr. Zoidberg from Futurama. Personally I have no problem with the Unix/Linux environment tools. I was looking for something that did not take a lot of computer smarts and could achieve group caching without overtones of TOU violations. Quote Link to comment
+New Jersey TJ Posted December 4, 2010 Share Posted December 4, 2010 Import it into Excel and strip out the extra columns . . . Quote Link to comment
jholly Posted December 4, 2010 Author Share Posted December 4, 2010 Import it into Excel and strip out the extra columns . . . I had thought of that, but my Excel 2000 does not grok xml files. Perhaps newer versions do. Quote Link to comment
+fegan Posted December 4, 2010 Share Posted December 4, 2010 OK, since you have Excel...run it through GPS Babel to create a CSV file, then load it into Excel and delete the extra columns. Quote Link to comment
Motorcycle_Mama Posted December 4, 2010 Share Posted December 4, 2010 And Extra POI Editor will also do the same thing. Quote Link to comment
jholly Posted December 4, 2010 Author Share Posted December 4, 2010 It seems that both GPSBabel and extra POI editor do put out csv files. But the files contain the cache NAME, not the GC code of the cache. I have not been able to figure out how to get the GC code into a column. Quote Link to comment
+fegan Posted December 4, 2010 Share Posted December 4, 2010 If your input file is input.gpx and your output file is output.csv use: gpsbabel -i gpx -f input.gpx -o unicsv -F output.csv From what I'm seeing, the 4th column will be the GCID. Quote Link to comment
+EScout Posted December 4, 2010 Share Posted December 4, 2010 It seems that both GPSBabel and extra POI editor do put out csv files. But the files contain the cache NAME, not the GC code of the cache. I have not been able to figure out how to get the GC code into a column. Did you miss post #5 above...... Quote Link to comment
+baloo&bd Posted December 4, 2010 Share Posted December 4, 2010 I am looking for a program to generate a list of GC codes that are in a .gpx file. Yes I know GSAK can do it. But GSAK is not an option. Think simple and cheap, like in zero. A File->input, File->output is what I am looking for. I played with GPSBabel GUI a bit but did not seem to find the combination, will that work? OK, here is a program that meets all your needs and requirements. GSAK, it is free if you don't mind the nag screen it trying to reinvent and you can quit trying to reinvent the wheel. It also has macros, an ability built in to filter on users as well as many workarounds listed in the forums to help with group caching. For me, time is money and this program is cheap at 3 times it's current price. So I have registered it as I am pretty sure Clyde feels the same way however he still offers it free ($0)with commercials. Quote Link to comment
jholly Posted December 4, 2010 Author Share Posted December 4, 2010 I am looking for a program to generate a list of GC codes that are in a .gpx file. Yes I know GSAK can do it. But GSAK is not an option. Think simple and cheap, like in zero. A File->input, File->output is what I am looking for. I played with GPSBabel GUI a bit but did not seem to find the combination, will that work? OK, here is a program that meets all your needs and requirements. GSAK, it is free if you don't mind the nag screen it trying to reinvent and you can quit trying to reinvent the wheel. It also has macros, an ability built in to filter on users as well as many workarounds listed in the forums to help with group caching. For me, time is money and this program is cheap at 3 times it's current price. So I have registered it as I am pretty sure Clyde feels the same way however he still offers it free ($0)with commercials. Excellent suggestion, and an excellent program and the first one I thought of. But as stated in the OP, that is not an option. Quote Link to comment
jholly Posted December 5, 2010 Author Share Posted December 5, 2010 If your input file is input.gpx and your output file is output.csv use: gpsbabel -i gpx -f input.gpx -o unicsv -F output.csv From what I'm seeing, the 4th column will be the GCID. got it. Quote Link to comment
Motorcycle_Mama Posted December 5, 2010 Share Posted December 5, 2010 It seems that both GPSBabel and extra POI editor do put out csv files. But the files contain the cache NAME, not the GC code of the cache. I have not been able to figure out how to get the GC code into a column. That's not what happened when I exported a file to CSV right before I posted. (I tested to see if it would work.) This is what I got. Longitude Latitude POI Name Address -76.292683 36.906767 GC23R34 -76.285267 36.898133 GCJHG7 -76.282683 36.9024 GCV22Q Quote Link to comment
+baloo&bd Posted December 5, 2010 Share Posted December 5, 2010 I am looking for a program to generate a list of GC codes that are in a .gpx file. Yes I know GSAK can do it. But GSAK is not an option. Think simple and cheap, like in zero. A File->input, File->output is what I am looking for. I played with GPSBabel GUI a bit but did not seem to find the combination, will that work? OK, here is a program that meets all your needs and requirements. GSAK, it is free if you don't mind the nag screen it trying to reinvent and you can quit trying to reinvent the wheel. It also has macros, an ability built in to filter on users as well as many workarounds listed in the forums to help with group caching. For me, time is money and this program is cheap at 3 times it's current price. So I have registered it as I am pretty sure Clyde feels the same way however he still offers it free ($0)with commercials. Excellent suggestion, and an excellent program and the first one I thought of. But as stated in the OP, that is not an option. However the only indication you gave as to why was cheap. Quote Link to comment
+DonB Posted December 5, 2010 Share Posted December 5, 2010 I am looking for a program to generate a list of GC codes that are in a .gpx file. Yes I know GSAK can do it. But GSAK is not an option. Think simple and cheap, like in zero. A File->input, File->output is what I am looking for. I played with GPSBabel GUI a bit but did not seem to find the combination, will that work? EasyGPS will do what you want. Quote Link to comment
John E Cache Posted December 5, 2010 Share Posted December 5, 2010 File dumb.style FIELD_DELIMITER TAB RECORD_DELIMITER NEWLINE OFIELD SHORTNAME, "", "%-.24s" gpsbabel -i gpx -f my.gpx -o xcsv,style=dumb.style -F my.new Quote Link to comment
John E Cache Posted December 5, 2010 Share Posted December 5, 2010 Yes I know GSAK can do it. But GSAK is not an option.That worked well. I know there are ways to put people in a kill file so you don't have to read their posts. I wish there was a way to filter out posts where people suggest using GSAK. Quote Link to comment
robertlipe Posted December 7, 2010 Share Posted December 7, 2010 While the question has been answered, as a 20+ year UNIX guy, I can't let this one go without a lesson in text processing. :-) cat xxx.gpx | grep '<name>GC' | cut -d\> -f 2 | cut -d\< -f1 that good enough? Two processes is better than four. Take advantage of knowing the traits of the text: grep "<name>"xxx.gpx | tr -d " /<>[:lower:]" Better still to use only one process: sed -n "s#.*<name>\(.*\)</name>#\\1#p" xxx Treating GPX/XML as plain text is kind of tacky, but if there's not great expressiveness in the input (i.e. you're parsing PQs from Groundspeak and not arbitrary GPX) that's OK. Quote Link to comment
John E Cache Posted December 8, 2010 Share Posted December 8, 2010 While the question has been answered, as a 20+ year UNIX guy, I can't let this one go without a lesson in text processing. :-) cat xxx.gpx | grep '<name>GC' | cut -d\> -f 2 | cut -d\< -f1 that good enough? Two processes is better than four. Take advantage of knowing the traits of the text: grep "<name>"xxx.gpx | tr -d " /<>[:lower:]" Better still to use only one process: sed -n "s#.*<name>\(.*\)</name>#\\1#p" xxx Treating GPX/XML as plain text is kind of tacky, but if there's not great expressiveness in the input (i.e. you're parsing PQs from Groundspeak and not arbitrary GPX) that's OK. OK, I admit it. As a perl zealot, I am more annoying than GSAK users. At least I don't use emacs. perl -e 'local $/, $_=<>; print join("\n", /name>\s*?(\S*?)\s*?<\/name/mg);' xxx.gpx Works if the <name> tag is split across lines, I think. Quote Link to comment
+dfx Posted December 8, 2010 Share Posted December 8, 2010 we didn't use awk yet: awk -F\> '/<name>GC/ {gsub(/<.*/, "", $2); print $2}' xxx.gpx Quote Link to comment
+fizzymagic Posted December 8, 2010 Share Posted December 8, 2010 My program AnalyzeTrack prints out a list of the waypoints in the gpx file. I use it for that all the time. I could make you a version that ONLY does that if you'd like. Quote Link to comment
jholly Posted December 8, 2010 Author Share Posted December 8, 2010 My program AnalyzeTrack prints out a list of the waypoints in the gpx file. I use it for that all the time. I could make you a version that ONLY does that if you'd like. PM sent. Quote Link to comment
+fizzymagic Posted December 9, 2010 Share Posted December 9, 2010 Application done. If anybody else wants it, let me know. I can put it up on the website. FWIW, it uses the Xerces C++ XML library and it is very fast. Less than a second per 500-cache file on my machine. Quote Link to comment
+fegan Posted December 9, 2010 Share Posted December 9, 2010 Application done. If anybody else wants it, let me know. I can put it up on the website. FWIW, it uses the Xerces C++ XML library and it is very fast. Less than a second per 500-cache file on my machine. Cool...thanks! Quote Link to comment
+fegan Posted December 9, 2010 Share Posted December 9, 2010 (edited) * double post * Edited December 9, 2010 by fegan Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.