Select to view content in your preferred language

Parse Path is including raster extension with "_"

669
3
Jump to solution
11-16-2023 10:26 AM
NoahWasserman
Regular Contributor

I'm trying to use the Parse Path utility in Arc Pro 3.1.3 Model Builder but the tool is including the extension in the Name output. I've tried selected or unselecting the "Format Name, Extension and Workplace" option but I'm still getting the "_asc" which is causing an error when I try to use this for a field name:

Input: .../raster2010apr.asc

Parse Path Name: raster2010apr_asc

In ArcMap the Parse Path utility gives the correct "raster2010apr" as the Name out put but not in Pro. 

0 Kudos
1 Solution

Accepted Solutions
NoahWasserman
Regular Contributor

It seems that the order in which you add in Parse Path matters.  If you add in Parse Path to a blank Model Builder and then add in your layer(s) it seems to exclude the file extension and give you a clean "%Name%".  Whereas if you add in Parse Path to an existing Model Builder that already has operations and layers in it then the outputs will include "_path".

View solution in original post

0 Kudos
3 Replies
DanPatterson
MVP Esteemed Contributor

There is the new tool

Parse Path (ModelBuilder)—ArcGIS Pro | Documentation

and the deprecated tool

Parse Path (ModelBuilder)—ArcGIS Pro | Documentation

make sure you are using the right one, since the syntax may differ


... sort of retired...
0 Kudos
NoahWasserman
Regular Contributor

I'm using the one available in the Model Builder "Utilities" drop down.  I just did another test, if I have  "test.tif" as my input and 1) use %Name% in the output function without Parse Path the output is literally "%Name%.tif" and 2) when I use Parse Path I get "test_tif" even with the "Format Name, Extension and Workspace" selected. Using %Name% works in the ArcPro batch function but I need to run multiple steps for 3000 rasters and have to ultimately add the file name as a field name to a zonal statistics table (<13 characters, which it won't be with the "_tif").

 

 

0 Kudos
NoahWasserman
Regular Contributor

It seems that the order in which you add in Parse Path matters.  If you add in Parse Path to a blank Model Builder and then add in your layer(s) it seems to exclude the file extension and give you a clean "%Name%".  Whereas if you add in Parse Path to an existing Model Builder that already has operations and layers in it then the outputs will include "_path".

0 Kudos