Merge all files in folder that match a wildcard
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
and finally
We would have
GLOBAL_MAPPER_SCRIPT VERSION=1.00 ENABLE_PROGRESS=YESThen how do I find the three shape types?
/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"
EDIT_VECTOR COPY_TO_NEW_LAYER=YES NEW_LAYER_NAME="Line" \then save each class
COMPARE_STR="??????"
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
Answers
-
I would really appreciate some help on this -are there details you need?
Categories
- 12.7K All Categories
- 5.6K Features Discussion
- 342 Downloading Imagery
- 1.3K Elevation Data
- 380 Georeferencing Imagery Discussion
- 628 GM Script Language
- 53 User Scripts
- 113 GPS Features
- 414 Projection Questions
- 819 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 177 Announcement and News
- 908 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 562 Other Discussion
- 129 GIS Data Sources
- 27 Global Mapper Showcase
- 233 How I use Global Mapper
- 107 Global Mapper Forum Website