I am building a model to produce 62 separate output files. I need an easy way to change output paths on all these outputs as the input data changes. I need them to keep their naming, just change a subfolder.
I tried creating a model variable and using the "@" notation, but apparently, that does not work in paths. Also, I am having some difficulty finding any useful data on this particular part of the Model Designer.
I marked the part that needs changing between runs in the image below.
The solution in this answer is either too complex for my needs or I just don't understand it.
1 Answer 1
As long as your outputs are shapefiles this works:
Set the outputs to pre-calculated values like:
array_to_string( array:=
string_to_array( string:=@folder_param, delimiter:='\\'),
delimiter:='/') || '/' || 'Buffer.shp'
I believe the problem when using just the @folder_param is that the paths have backslashes in them, like C:\folder\buffer.shp
when it needs to be forward slashes: C:/folder/buffer.shp
.
The expression splits the folder path into an array ['C:', 'folder']
and joins it back to a string using / as delimiters.
(I select the folder C:\Users\bera\Desktop\gistest111円
when executing the model.)
Explore related questions
See similar questions with these tags.
D:/Datai/Municip1/...
thenD:/Datai/Municip2/
...