Import script not working
fvidania
Global Mapper UserTrusted User
Hello all,
First of all, I want to say that I'm new to this Scripting world. I'm trying to do one easy script to import a .csv that I have in my PC. I know it's a very simple script, but I want to practice and see how the language works.
I wrote the script and when I open it with GM (File/Run Script...), I click on Run Script and this is what happen.
the screen says: "Removed all loaded overlays" "Importing ASCII file C:.....¨and nothing else. That´s all it does. Before this, the software asks me for the projection, I chose NAD83 UTM and click OK. After this, nothing else happens. It´s a very small CSV, only 5 points.
See my language:
GLOBAL_MAPPER_SCRIPT VERSION=1.00
UNLOAD_ALL
IMPORT_ASCII \
FILENAME="C:\Users\fer.surfacefer\Desktop\TEST.CSV" \
TYPE=POINT_ONLY \
COORD_DELIM=COMMA \
SKIP_COLUMNS=1\
COORD_ORDER=Y_FIRST \
INC_COORD_LINE_ATTRS=YES\
INC_ELEV_COORDS=YES\
What am I doing wrong? what am I missing?
Thanks
First of all, I want to say that I'm new to this Scripting world. I'm trying to do one easy script to import a .csv that I have in my PC. I know it's a very simple script, but I want to practice and see how the language works.
I wrote the script and when I open it with GM (File/Run Script...), I click on Run Script and this is what happen.
the screen says: "Removed all loaded overlays" "Importing ASCII file C:.....¨and nothing else. That´s all it does. Before this, the software asks me for the projection, I chose NAD83 UTM and click OK. After this, nothing else happens. It´s a very small CSV, only 5 points.
See my language:
GLOBAL_MAPPER_SCRIPT VERSION=1.00
UNLOAD_ALL
IMPORT_ASCII \
FILENAME="C:\Users\fer.surfacefer\Desktop\TEST.CSV" \
TYPE=POINT_ONLY \
COORD_DELIM=COMMA \
SKIP_COLUMNS=1\
COORD_ORDER=Y_FIRST \
INC_COORD_LINE_ATTRS=YES\
INC_ELEV_COORDS=YES\
What am I doing wrong? what am I missing?
Thanks
Comments
-
There's an extra backslash ending the last line. It tells GM to expect more parameters to the IMPORT_ASCII command, but there are none. So remove that.
You might also have problems with the apparent space after the file extension. -
Thank you! I had two problems. One that last backslash at the end.
Other is that I wasn't checking the box "Run Script in the Context of the Main View"
After those two changes, everything works. I've been able to load a dxf as well in the same script, so I'm understanding everything now.
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