Global Mapper v25.0

Wildcards in IMPORT_ARCHIVE FILENAME parameter ?

EricGagne
EricGagne Global Mapper UserTrusted User
edited October 2011 in GM Script Language
Hello,

I have many .zip files that I downloaded from the Canadian Government servers. Each file contains multiple shapefiles for different topographic information.

For now I'm only interested in loading the files that contain the letters TR which are the routes layers. I tried to that with the IMPORT_ARCHIVE command in a script but GM doesn't seem to understands "*TR*" in the FILENAME parameter.

Is it possible to use wildcards to specify a file pattern to import from an archive ?



GLOBAL_MAPPER_SCRIPT VERSION=1.00
UNLOAD_ALL

DIR_LOOP_START DIRECTORY="C:\MapData\Canvec\032\a" FILENAME_MASKS="*.ZIP" RECURSE_DIR=NO

IMPORT_ARCHIVE ARCHIVE_FILENAME="%FNAME_W_DIR%" FILENAME="*TR*" ANTI_ALIAS=YES

// End the loop
DIR_LOOP_END

Comments

  • global_mapper
    global_mapper Administrator
    edited October 2011
    I have updated the IMPORT_ARCHIVE command to support wildcards in the FILENAME parameter. I have placed a new build at http://www.globalmapper.com/global_mapper13.zip with the change for you to try. Simply download that file and extract the contents into your existing v13.xx installation folder to give it a try. If you are using the 64-bit v13 version there is a new build at http://www.globalmapper.com/global_mapper13_64bit.zip .

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • EricGagne
    EricGagne Global Mapper User Trusted User
    edited October 2011
    It didn't work at first because the zip files contain more than shapefiles, they also have text, dbf, cpp files and more. The program prompted me every time for a file type. I tried FILENAME=*TR*.shp but that didn't work either.

    Adding TYPE=SHAPEFILE did the trick, the script log is loaded with warnings about the other files not being valid Shapefiles but that's not a problem, all the shape files containing TR were loaded.

    This is really great Mike, you just saved me many hours of manual work.

    Thank you.
  • global_mapper
    global_mapper Administrator
    edited October 2011
    If you add PROMPT_IF_TYPE_UNKNOWN=NO to the IMPORT_ARCHIVE command you should be able to get away with not providing the type either.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • EricGagne
    EricGagne Global Mapper User Trusted User
    edited October 2011
    Ha !!

    I should have searched for the word "prompt" in the scripting language reference :)

    Thanks again Mike.