Re: [Gpsbabel-misc] "Height Filter" in GUI version of GPSBabel 1.3.6 download?
Brought to you by:
robertl
From: Timothy M. <ex...@ea...> - 2009-04-04 13:25:13
|
Martin, thanks again for all of your suggestions. I found the "E:ON" parameter, but I also read in the information that follows that "Command Extensions are enabled by default. You may disable extensions for a particular invocation by using the /E:OFF switch...", so it looks like this should already be enabled and working, but I tried both of your suggestions to enable it anyway, unfortunately without success in generating an output file. I also tried reverting to using %1 instead to re-focus my attention to the output file path using your other suggestions. This also did not work, but oddly enough, I discovered that a file of some sort called "Documents" is being written to the root directory of my C: drive, and has been doing so for previous versions of syntax I have used over the last couple of days when my preferred output file path has been included in the .bat file. I should say that the preferred output file directory that I am specifying DOES already exist. Is this "Documents" file icon appearing because GPSBabel is trying to recreate the file path and stopping short when it realizes that there will be a conflict if it does, since that file path is already in place? Does there need to be some command to tell it to "look for the specified directory and write the output file into it," as opposed to: "create output file and specified directory structure around it here"? (....which is what it looks like it might be trying to do). Any further help or insight that you might provide would be a great help; however, if I have to, I suppose I can still use what I know works and move the file manually after conversion to the directory I want it to end up in, and delete the "pre-extension". (Still, it would be nice if I could get the fully-automated process to work.) ;^) Thanks again for your help (and your patience). Tim -----Original Message----- >From: Martin Erzberger <ma...@er...> >Sent: Apr 4, 2009 1:03 AM >To: 'Timothy McQuaide' <ex...@ea...>, gps...@li... >Subject: AW: [Gpsbabel-misc] "Height Filter" in GUI version of GPSBabel 1.3.6 download? > >Hello > >Windows Vista, possibly also WinXP supports the extended batch syntax (of which the "%~n1" trick is an example) by default. It is possible that Windows 2000 doesn't. Try "help cmd" on a command prompt and look for a parameter "/E:ON" which would enable this. >Alternatively, try to rename your batchfile from xxx.bat to xxx.cmd, I faintly recall that this enables the extended syntax as well. > >About the output directory: Just paste everything together (once the "%~n1" Trick works) and you will be there. E.g. >-F "C:\Documents and Settings\Tim McQuaide\My Documents\GPS Data\GPX tracklogs\"%~n1.gpx >(note the quotes because of the blanks in your path!) will do what you want. > >If your gpx filename has blanks in it you need two quotes more (...tracklogs\""%~n1.gpx"). Even if not: The quotes don't hurt. > >Regards, Martin > >-----Ursprüngliche Nachricht----- >Von: Timothy McQuaide [mailto:ex...@ea...] >Gesendet: Samstag, 4. April 2009 08:41 >An: gps...@li... >Betreff: Re: [Gpsbabel-misc] "Height Filter" in GUI version of GPSBabel 1.3.6 download? > >JB and Martin, thank you both for your suggestions...I've been reading up and trying stuff as I learn. Still having trouble, though. > >Martin, > >I tried your %OUTPUT_DIR% suggestion, and while it is pretty cool how it works, it doesn't quite do what I want it to do. > >What if I always want my output file to end up in the same ("predetermined") directory ("time after time", without having to specify it at the command prompt); but, however, that directory is different from the source file's file path? How might I express that in a working GPSBabel command line? > >I'd like the output files to always be saved in this directory: > >C:\Documents and Settings\Tim McQuaide\My Documents\GPS Data\GPX tracklogs\ > >Also I tried your suggestion for using the expression "%~n1" for getting just the filename (which, coincidentally, is the same as what I saw on the following link posted by Robert Lipe in an earlier thread): > >http://www.gpsbabel.org/os/Windows_Drag_and_Drop.html > >....but it doesn't seem to work on my Windows 2000 SP4 laptop, and no output file is generated. Using just "%1" generates my output file, but with both source file and output file extensions included. > >The following command line below (which I am using in a .bat file in the GPSBabel Folder with a "drag & drop" shortcut on the desktop) expresses (in incorrect syntax, I know) what I'd like to do, but it just doesn't seem to work: > >gpsbabel.exe -p "" -w -i nmea -f %1 -x height,wgs84tomsl -o gpx -F C:\Documents and Settings\Tim McQuaide\My Documents\GPS Data\GPX tracklogs\%~n1.gpx > >This must have errors in it because no output file is generated, but it might give you an idea of how I'd like GPSBabel to handle conversion and output file path using my .bat file. > >Any suggestions? > >Thanks again for your help. > >Tim > > > >Original Message: > >Re: [Gpsbabel-misc] "Height Filter" in GUI version of GPSBabel 1.3.6 download? Timothy McQuaide <exit105@ea...> > >Re: [Gpsbabel-misc] "Height Filter" in GUI version of GPSBabel 1.3.6 download? >From: Martin Erzberger <martin@er...> - 2009-04-03 13:48 >Hello > >To get just the filename, use instead of "%1" the expression "%~n1". >So ... -F %~n1.gpx > >For the directory, you can use this syntax: > >SET /P OUTPUT_DIR=Output Directory: > >You will then be prompted and your input is then in the variable >%OUTPUT_DIR% > >All in all, something like this: > >@ECHO OFF >SET /P OUTPUT_DIR=Output Directory: >gpsbabel.exe -p "" -w -i nmea -f %1 -x height,wgs84tomsl -o gpx -F >%OUTPUT_DIR%\%~n1.gpx > > > >My conversion script is rather more complicated, because I usually have a >number of files to be combined into one output file: > >@ECHO OFF >SET INPUTFORM=nmea >SET INPUTEXT=txt >SET FILTER=-x discard,hdop=3,vdop=3,pdop=5,sat=4,fixnone,fixunknown >SET GPS_OUTPUT_DIRECTORY=C:\Users\me\Documents\GPX >SET GPS_INPUT_DIRECTORY=C:\Users\me\Documents\GPX\Download >SET GPSBABEL=C:\cygwin\home\me\gpsbabel\gpsbabel\gpsbabel.exe >SET /P OUTPUT_FILENAME=Output Filename (Without Extension): >CLS >ECHO Converting >ECHO Input Format: %INPUTFORM% >Echo Input File Extension: %INPUTEXT% >if exist "%TEMP%\InputFiles.txt" del "%TEMP%\InputFiles.txt" >echo -i %INPUTFORM% >> "%TEMP%\InputFiles.txt" >FOR /F "usebackq delims==" %%i IN (`dir "%GPS_INPUT_DIRECTORY%\*.%INPUTEXT%" >/b`) DO @echo -f "%GPS_INPUT_DIRECTORY%\%%i" >> "%TEMP%\InputFiles.txt" >ECHO Input Files are: >type "%TEMP%\InputFiles.txt" > >ECHO %INPUTFORM% to GDB... >%GPSBABEL% -p "" -w -r -t -b "%TEMP%\InputFiles.txt" %FILTER% -x >track,merge,split -o gdb -F "%GPS_OUTPUT_DIRECTORY%\%OUTPUT_FILENAME%.gdb" >ECHO %INPUTFORM% to GPX... >%GPSBABEL% -p "" -w -r -t -b "%TEMP%\InputFiles.txt" %FILTER% -x >track,merge,split -o gpx -F "%GPS_OUTPUT_DIRECTORY%\%OUTPUT_FILENAME%.gpx" > >del "%TEMP%\InputFiles.txt" > > >Hope this helps, regards, Martin > >-----Ursprüngliche Nachricht----- >Von: Timothy McQuaide [mailto:exit105@ea...] >Gesendet: Freitag, 3. April 2009 09:26 >An: gpsbabel-misc@li... >Betreff: Re: [Gpsbabel-misc] "Height Filter" in GUI version of GPSBabel >1.3.6 download? > >Robert, thanks for the helpful info. > >Being an adventurous novice, I decided to try out using command lines, and I >used the info that was provided on the link that you gave me regarding >"Windows Drag and Drop" and combined it with the "wgs84tomsl" height filter >command to create my NMEATOGPX.BAT file, which I then saved into the same >directory as GPSBabel.exe, and to which created a shortcut on the desktop. > >The syntax I used is as follows below, and while it DID work, I would like >to "fine tune" my command line a little bit to (A) have the output file end >up in a directory which I specify, and (B) not have the output file end up >with a filename that has a "double extension" (in this case, .nma.gpx) on >the end. > >Here's what I know works so far: > >gpsbabel.exe -p "" -w -i nmea -f %1 -x height,wgs84tomsl -o gpx -F %1.gpx > >I have seen this command sequence successfully take an NMEA0183 file that I >had previously saved from my iBlue 757Pro's data log (using its included >software) and convert it to GPX format with corrected altitude (altitude >filter seems to work great) and save it in the same directory as the source >file and with a .nma.gpx extension on the end (after having dragged it to >the shortcut that I created for my .bat file on the desktop.) This is great >so far! > >I would like the output file to end up in the following directory: > >C:\Documents and Settings\Tim McQuaide\My Documents\GPS Data\GPX tracklogs\ > >....and I would like the output file to only have the 3-letter extension on >the end (in this case, .gpx). > >I have tried the example on the "Windows Drag and Drop" link you posted for >removing the source file's extension that appears before the actual >extension, and I have tried specifying the output file path between the -F >command and the %1 (or %~nl) "wildcard" filename, but this is where I am >running into problems. > >Every variation in the syntax I have tried so far has resulted in no output >file being generated. I have probably tried too many variations to list >here, and I'm not sure if I remember all of them at this point. (I was sort >of hoping that you might be willing to just "spell it out for me", since I >am kind of "at a loss". > >Any chance you could "throw me a bone" here? I've been "chasing my own >tail" for hours. > >Thanks again. > >Tim > >---------------------------------------------------------------------------- >-- >_______________________________________________ >Gpsbabel-misc mailing list http://www.gpsbabel.org >Gpsbabel-misc@li... >To unsubscribe, change list options, or see archives, visit: >https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc > > >Re: [Gpsbabel-misc] "Height Filter" in GUI version of GPSBabel 1.3.6 download? >From: JB Lewis <jblewis@gm...> - 2009-04-03 14:38 > >Attachments: Message as HTML >http://www.robvanderwoude.com/parameters.php >Scroll down to "More options in Windows NT4/2000/XP" > >JB > >On Fri, Apr 3, 2009 at 8:31 AM, Martin Erzberger <martin@er...>wrote: > >> Hello >> >> To get just the filename, use instead of "%1" the expression "%~n1". >> So ... -F %~n1.gpx >> >> For the directory, you can use this syntax: >> >> SET /P OUTPUT_DIR=Output Directory: >> >> You will then be prompted and your input is then in the variable >> %OUTPUT_DIR% >> >> All in all, something like this: >> >> @ECHO OFF >> SET /P OUTPUT_DIR=Output Directory: >> gpsbabel.exe -p "" -w -i nmea -f %1 -x height,wgs84tomsl -o gpx -F >> %OUTPUT_DIR%\%~n1.gpx >> >> >> >> My conversion script is rather more complicated, because I usually have a >> number of files to be combined into one output file: >> >> @ECHO OFF >> SET INPUTFORM=nmea >> SET INPUTEXT=txt >> SET FILTER=-x discard,hdop=3,vdop=3,pdop=5,sat=4,fixnone,fixunknown >> SET GPS_OUTPUT_DIRECTORY=C:\Users\me\Documents\GPX >> SET GPS_INPUT_DIRECTORY=C:\Users\me\Documents\GPX\Download >> SET GPSBABEL=C:\cygwin\home\me\gpsbabel\gpsbabel\gpsbabel.exe >> SET /P OUTPUT_FILENAME=Output Filename (Without Extension): >> CLS >> ECHO Converting >> ECHO Input Format: %INPUTFORM% >> Echo Input File Extension: %INPUTEXT% >> if exist "%TEMP%\InputFiles.txt" del "%TEMP%\InputFiles.txt" >> echo -i %INPUTFORM% >> "%TEMP%\InputFiles.txt" >> FOR /F "usebackq delims==" %%i IN (`dir >> "%GPS_INPUT_DIRECTORY%\*.%INPUTEXT%" >> /b`) DO @echo -f "%GPS_INPUT_DIRECTORY%\%%i" >> "%TEMP%\InputFiles.txt" >> ECHO Input Files are: >> type "%TEMP%\InputFiles.txt" >> >> ECHO %INPUTFORM% to GDB... >> %GPSBABEL% -p "" -w -r -t -b "%TEMP%\InputFiles.txt" %FILTER% -x >> track,merge,split -o gdb -F "%GPS_OUTPUT_DIRECTORY%\%OUTPUT_FILENAME%.gdb" >> ECHO %INPUTFORM% to GPX... >> %GPSBABEL% -p "" -w -r -t -b "%TEMP%\InputFiles.txt" %FILTER% -x >> track,merge,split -o gpx -F "%GPS_OUTPUT_DIRECTORY%\%OUTPUT_FILENAME%.gpx" >> >> del "%TEMP%\InputFiles.txt" >> >> >> Hope this helps, regards, Martin >> >> -----Ursprüngliche Nachricht----- >> Von: Timothy McQuaide [mailto:exit105@ea...] >> Gesendet: Freitag, 3. April 2009 09:26 >> An: gpsbabel-misc@li... >> Betreff: Re: [Gpsbabel-misc] "Height Filter" in GUI version of GPSBabel >> 1.3.6 download? >> >> Robert, thanks for the helpful info. >> >> Being an adventurous novice, I decided to try out using command lines, and >> I >> used the info that was provided on the link that you gave me regarding >> "Windows Drag and Drop" and combined it with the "wgs84tomsl" height filter >> command to create my NMEATOGPX.BAT file, which I then saved into the same >> directory as GPSBabel.exe, and to which created a shortcut on the desktop. >> >> The syntax I used is as follows below, and while it DID work, I would like >> to "fine tune" my command line a little bit to (A) have the output file end >> up in a directory which I specify, and (B) not have the output file end up >> with a filename that has a "double extension" (in this case, .nma.gpx) on >> the end. >> >> Here's what I know works so far: >> >> gpsbabel.exe -p "" -w -i nmea -f %1 -x height,wgs84tomsl -o gpx -F %1.gpx >> >> I have seen this command sequence successfully take an NMEA0183 file that I >> had previously saved from my iBlue 757Pro's data log (using its included >> software) and convert it to GPX format with corrected altitude (altitude >> filter seems to work great) and save it in the same directory as the source >> file and with a .nma.gpx extension on the end (after having dragged it to >> the shortcut that I created for my .bat file on the desktop.) This is >> great >> so far! >> >> I would like the output file to end up in the following directory: >> >> C:\Documents and Settings\Tim McQuaide\My Documents\GPS Data\GPX tracklogs\ >> >> ....and I would like the output file to only have the 3-letter extension on >> the end (in this case, .gpx). >> >> I have tried the example on the "Windows Drag and Drop" link you posted for >> removing the source file's extension that appears before the actual >> extension, and I have tried specifying the output file path between the -F >> command and the %1 (or %~nl) "wildcard" filename, but this is where I am >> running into problems. >> >> Every variation in the syntax I have tried so far has resulted in no output >> file being generated. I have probably tried too many variations to list >> here, and I'm not sure if I remember all of them at this point. (I was >> sort >> of hoping that you might be willing to just "spell it out for me", since I >> am kind of "at a loss". >> >> Any chance you could "throw me a bone" here? I've been "chasing my own >> tail" for hours. >> >> Thanks again. >> >> Tim >> >> >> ---------------------------------------------------------------------------- >> -- >> _______________________________________________ >> Gpsbabel-misc mailing list http://www.gpsbabel.org >> Gpsbabel-misc@li... >> To unsubscribe, change list options, or see archives, visit: >> https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc >> >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Gpsbabel-misc mailing list http://www.gpsbabel.org >> Gpsbabel-misc@li... >> To unsubscribe, change list options, or see archives, visit: >> https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc >> > > >------------------------------------------------------------------------------ >_______________________________________________ >Gpsbabel-misc mailing list http://www.gpsbabel.org >Gps...@li... >To unsubscribe, change list options, or see archives, visit: >https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc > |