Can a null value be allowed in ATTR_REPLACE_STR?
kbellis
Global Mapper UserTrusted User
Apparently, a null value isn't acceptable in this example of ATTR_REPLACE_STR
In the GUI's Search and Replace action, null values work, but not in this scripting scenario. Still, I wonder, can a null value somehow be allowed?
Answers
-
Hello,
Your parameterATTR_REPLACE_STR=".JPG="
is incorrect. It needs to contain three pieces of information, separated by equal signs: the attribute name, the string value to replace, and the new string value. This is what the error message is referring to. Assuming your attribute is FILE_NAME, the correct syntax is:ATTR_REPACE_STR="FILE_NAME=.JPG="
I think this syntax will replace ".JPG" with an empty string.
Cheers,
Bob -
bmg_bob said:Hello,
Your parameterATTR_REPLACE_STR=".JPG="
is incorrect. It needs to contain three pieces of information, separated by equal signs: the attribute name, the string value to replace, and the new string value. This is what the error message is referring to. Assuming your attribute is FILE_NAME, the correct syntax is:ATTR_REPACE_STR="FILE_NAME=.JPG="
I think this syntax will replace ".JPG" with an empty string.
Cheers,
BobYes! You've got it! - except in this instance, to be precise, it's actually ATTR_REPLACE_STR="NAME=.JPG=" , and not FILE_NAMEOne nuance on this worth noting; because the .JPG falls at the end of the string, this worked fine; however, using ATTR_REPLACE_STR="NAME=DJI_0=" to strip the front end bits of text, results in the a null value for the attribute NAME, thus why I added back the 0Thank you for your help and clear explanation.
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