Jump to content

Renaming Gpx Files.


DomHeknows

Recommended Posts

I was bored this afternoon waiting for some tapes to restore so I decided to have a quick look at a way of working out which gpx file is which when they arrive from geocaching. Afterall 34489 doesn't mean much.

I knocked up this quick batch file (works with w2k, xp) that is placed in the same directory that the gpx files are saved in from an email.

A quick edit of the batch file (below) and then running the file will rename the 12345.gpx to something like cachesnearme-12345.gpx with the old cachesnearme-12345.gpx renamed to .old (and the .old file deleted if it exists).

Everytime you do a new query just edit the batch file as appropriate and run it.

 

For debugging purposes, drop to a dos prompt, change to the directory the batch file is in and type

set echo=on

and every line will be echoed to screen

Type

set pause=pause

to pause between each gpx file process.

 

Hope this makes sense and may be useful to people!

 

@echo off

setlocal

echo %echo%

 

rem ----------edit between these lines as appropriate

call :movefiles 42168 found-42168

call :movefiles 39489 home-39489

call :movefiles 44001 rew-44001

call :movefiles 42567 bury-42567

call :movefiles 39985 bicester-39985

rem ----------edit between these lines as appropriate

 

rem Finished processing - quit

endlocal

goto :eof

 

:movefiles

::%1=filenamefromgeocaching

::%2=descriptivename

if not exist %1.gpx goto :eof

%pause%

del %2.old.gpx

move %2.gpx %2.old.gpx

move %1.gpx %2.gpx

echo %1 moved to %2.gpx

goto :eof

%pause%

Link to comment

I have a little program that Pegasus Mail automatically calls whenever GPX mail arrives. It rebuilds the 7-bit encode data back into its original form, saves it as a file, renaming it to the name assigned to the PQ (which is extracted from the subject line) plus the date it was generated, and puts the file on the desktop after deleting the previous version.

 

Pegasus then tags the mail as having been read, and moves it to a storage folder.

Edited by Prime Suspect
Link to comment
I have a little program that downloads the GPX file into Streets and Trips, maps out a route, transmits the route to the StreetPilot in my car, sends a remote signal to start my car, and then commands Streets and Trips to drive the route. I've logged over 500 finds without leaving my desk.

but does it make the coffee/tea/beverage of your choice ;-)

Link to comment

I am running Outlook. What is the easiest way to automate the saving of an attached file to a specified folder when a message arrives? I'd like to have this done automatically so that I can run my batch file for manipulating and converting my PQs without having manually save off all of my Pocket Queries from mail first.

Link to comment
I am running Outlook. What is the easiest way to automate the saving of an attached file to a specified folder when a message arrives? ...

I have thought about doing some kind of the same thing I just have not gotten around to it.

 

But you may want to start by looking under Tools | Rules and alerts ... in Outlook. I have not tried it but it looks like it pretty much walks you through the process of building the rule.

 

Hope that helps or at least heads you in somewhat the correct direction.

Link to comment
But you may want to start by looking under Tools | Rules and alerts ... in Outlook. I have not tried it but it looks like it pretty much walks you through the process of building the rule.

I gave that a look but didn't find an option to automatically save an attachment. I didn't look all that hard, though - I'll do so later tonight.

Link to comment

My last link will actually let you create a rule that extracts (and even unzips) the attachment to a directory of your choice, then allows you to run an external application against the file you extracted. Seems like a better solution.

 

Outlook comes default with a rule that can check for an attachment, but it doesn' allow you to save that attachment as part of the rules. If that were the case you could have another application monitor a particular directory and execute itself whenever something changes.

Link to comment

you could probably write your own if you known visual basic (for applications) or look at http://www.outlookcode.com/ for some possible solutions to help you write it?

Actually there is an article on the front page for doing this - see http://www.outlookcode.com/codedetail.aspx?id=70 for more info

 

EDITED for more specific information

Edited by DomHeknows
Link to comment
Guest
This topic is now closed to further replies.
×
×
  • Create New...