Global Mapper v25.0

Merge all files in folder that match a wildcard

George Chandeep Corea
George Chandeep Corea Global Mapper UserTrusted User
I would like to write a script that would prompt for a wildcard say "sewer*.tab" and then merge all those files into a single set of shp files that are named "sewer_line.shp", "sewer_point.shp", "sewer_poly.shp".

We would have

GLOBAL_MAPPER_SCRIPT VERSION=1.00 ENABLE_PROGRESS=YES
/rather then specifying directory can it just run in the folder it's in?
DEFINE_VAR NAME="input_dir" VALUE="" /it should create this directory
DEFINE_VAR NAME="output_dir" VALUE="GMS_Processed\"
SET_LOG_FILE FILENAME="contour_processing.log"
/change file format if required /can we set this in a dialogue or does it have to be in the script?
DIR_LOOP_START DIRECTORY="%input_dir%" FILENAME_MASKS="*.tab"  RECURSE_DIR=NO
/change projection
IMPORT FILENAME="%FNAME_W_DIR%" TYPE=SHAPEFILE PROJ="EPSG:28355"
Then how do I find the three shape types?
EDIT_VECTOR COPY_TO_NEW_LAYER=YES NEW_LAYER_NAME="Line" \
    COMPARE_STR="??????"
then save each class
EXPORT_VECTOR FILENAME="%output_dir%\%FNAME_WO_EXT%_line.tab" TYPE=SHAPEFUKE EXPORT_LAYER="Line" INC_LAYER_ATTR=NO INC_ELEV_ATTR=YES PROJ="EPSG:28355"

and finally
/clear memory and continue
UNLOAD_ALL
DIR_LOOP_END


Tagged:

Answers