Re: Gpsbabel - how to do all files in a directory

From: John Navas (spamfilter0_at_navasgroup.com)
Date: 08/26/04


Date: Thu, 26 Aug 2004 23:03:20 GMT


[POSTED TO sci.geo.satellite-nav - REPLY ON USENET PLEASE]

To get rid of the spaces:

  Change \tmp\*.mps to "\tmp\*.mps"
  Change %%X to %%~sX
  Change %%~dpnX.txt to %%~sdpnX.txt

In <IwsXc.519766$Gx4.286681@bgtnsc04-news.ops.worldnet.att.net> on Thu, 26 Aug
2004 21:22:48 GMT, "Tom H." <tom_reader@att.nospam*.net> wrote:

>John,
>That worked like charm! The only thing that caused me a problem for a
>couple of minutes was taking the spaces out of my folder names and file
>names so the command interpreter would execute properly from the .bat file
>that I created.
>
>Tom
>"John Navas" <spamfilter0@navasgroup.com> wrote in message
>news:4JoXc.9866$54.141842@typhoon.sonic.net...
>> [POSTED TO sci.geo.satellite-nav - REPLY ON USENET PLEASE]
>>
>> gpsbabel doesn't seem to support filename wildcards, so you have to do
>this
>> programmatically; e.g., with a script or (with Windows NT/2000/XP command
>> extensions) batch file. In the latter case, the following example text
>would
>> be in a file with a .CMD extension:
>>
>> FOR %%X IN (\tmp\*.mps) DO gpsbabel -i mapsource -o text %%X
>%%~dpnX.txt
>>
>> The "\tmp\*.mps" creates a list of all files in the \tmp directory that
>have
>> ".mps" as the extension. ("*" is a 'wildcard' that matches any
>characters.)
>> The "FOR" command then processes that list, one file at a time, each time
>> substituting one of the filenames for "%%X". The "%%~dpnX.txt" is used to
>> build a corresponding output filename with the same drive-path-name ("dpn"
>> modifier on "X") plus ".txt" as the extension. Hence if \tmp contained
>> FILE1.MPS, FILE2.MPS, and FILE3.MPS, "FOR" would execute the following
>> commands:
>>
>> gpsbabel -i mapsource -o text \tmp\FILE1.MPS \tmp\FILE1.TXT
>> gpsbabel -i mapsource -o text \tmp\FILE2.MPS \tmp\FILE2.TXT
>> gpsbabel -i mapsource -o text \tmp\FILE3.MPS \tmp\FILE3.TXT
>>
>> Hope that helps.
>>
>> Best regards,
>> John Navas
>>
>> In <DOcXc.517073$Gx4.105763@bgtnsc04-news.ops.worldnet.att.net> on Thu, 26
>Aug
>> 2004 03:29:39 GMT, "Tom H." <tom_reader@att.nospam*.net> wrote:
>>
>> >I would like to convert all files in a directory and am having trouble
>> >interpreting how to get gpsbabel to convert a few Mapsource files to text
>> >files. The readme has the following statement:
>> >
>> >gpsbabel -i geo -f /tmp/geocaching.loc -o gpx -F /tmp/geocaching.gpx
>> >tells it to read the first file in geocaching.com format and create
>> > a new file in GPX format.
>> >
>> >I tried doing this as shown below
>> >
>> >C:\Program Files\gpsbabel>gpsbabel -i mapsource -f
>/tmp/mapsource.mps -o -F
>> >/tmp
>> >/text.txt
>> >MAPSOURCE cannot open '/tmp/mapsource.mps' for read. Error was 'No such
>> >file or
>> > directory'.
>> >
>> >I am not used to command line instructions, so I am probably
>interpreting
>> >the example command improperly. Can someone give me some help with more
>> >details on how to do this.
>> >
>> >TIA,
>> >Tom
>>
>

-- 
Best regards,
John Navas     <http://navasgrp.home.att.net/>


Relevant Pages

  • Re: Cingular GSM v. digital
    ... [POSTED TO alt.cellular.cingular - REPLY ON USENET PLEASE] ... >John Navas wrote: ... >>>Then it should be easy to list links. ... >When someone asks yout o cite reliable sources, ...
    (alt.cellular.cingular)
  • Re: Look at Nancy McGough Run (was: Re: [Regular Posting] Mail Filters that use Challenge-Responses)
    ... >> means dosn't inspire confidence in your ability to deal with it. ... it's very inconsiderate of Joe to use words with more than two ... How does posting your real address on Usenet gets rid of you? ...
    (comp.os.linux.misc)
  • Re: Home Zip & Signal, V551
    ... [POSTED TO alt.cellular.cingular - REPLY ON USENET PLEASE] ... >John Navas wrote: ... > Mox may want to borrow his coworker's phone and test it out before ...
    (alt.cellular.cingular)
  • Re: r.p.d.zlr
    ... John Navas wrote: ... most active newsgroup in all of Usenet, ... Actually following the negative trend -- traffic is way down from its ... Usenet hangout; I'm still the all-time leading poster, there, with 535 ...
    (rec.photo.digital)
  • Re: ABPW - Would someone please post a link?
    ... I believe ISP's just used child-porn as their vehicle to get rid of usenet ... as an unprofitable venture. ...
    (rec.woodworking)

Quantcast