I am using the following code $if($eql($strstr(%_folderpath%,Archived),0),Archived,Not) to create a custom column named "State" and assigns the word "Archived" if the folder path of the file contains the word "Archived".
Now, I want to assign the words "Archived", "Uncategorized", or "Unchecked" if the folder path of the file contains any of these words. If none of these words are present in the folder path, I want to assign the word "Nothing". Is this possible?
It checks whether there is a string xxxxx somewhere in the %_Folderpath% after the keywords you have supplied have been replaced by xxxxx.
Your description lacks what should be done if there is no hit - I assumed the - as a good display.
You can test the expression in Convert>Tag-Tag and see whether it produces the correct result or what the difference between the code and the data could be.
Screenshots help a lot.
For the general proceeding:
If you want to treat the file afterwards - wouldn't a filter be much easier to handle? It is not clear to me what you do with the data in the new column.
The basic formula would be $ifgreater($strstr(%_folderpath%,Archived),0,found,not found)
If the position of the word Archived in the current folderpath will be greater then 0, then return found, else return not found.
As you like to see at least 4 possible variants, you would have to cascade this formula.
This becomes pretty illegible: $ifgreater($strstr(%_folderpath%,Archived),0,found1,$ifgreater($strstr(%_folderpath%,Uncategorized),0,found2,$ifgreater($strstr(%_folderpath%,Unchecked),0,found3,everything else)))
When it prints found1 into "State" column everything is fine. But when it prints found2 looks like this "__found2" and for found3 like this "____found3". It adds two spaces for found2 and four spaces for found3. Any idea why is this happening?