I am very new to Switch, so please forgive what might be a easy question to you
I am trying to get files into a folder that is already created -- problem seems that the file name has the additional info in it separated by "_"
So I need my Path to find the folder that is named "123456_Customername" -- From a file named "123456_Customername_Labels" and place that file in that folder with the file name in tact
I have tried to use [Job.NameProper] and [Job.NameProper:Before="_"]
Remove part of a file name
-
- Newbie
- Posts: 3
- Joined: Thu Jul 24, 2025 7:20 pm
Re: Remove part of a file name
I figured it out with a little help from my friend Grok
[Job.NameProper:Search="^(\d{6}_[^_]+)"] seems to be working well - Thanks
[Job.NameProper:Search="^(\d{6}_[^_]+)"] seems to be working well - Thanks
Re: Remove part of a file name
That is indeed the most efficient way for your use case.
For the sake of education, there is another possible approach: the app StringSplitter (https://www0.enfocus.com/en/appstore/pr ... ngsplitter). This app creates private data for each part of a string based on a certain separator, underscore in your case. You can then recombine part 1 with part 2. Again, for your use case the StringSplitter approach is less efficient, but if you needed to recombine part 1 with part 4 and then part 2, for example, you would need it.
For the sake of education, there is another possible approach: the app StringSplitter (https://www0.enfocus.com/en/appstore/pr ... ngsplitter). This app creates private data for each part of a string based on a certain separator, underscore in your case. You can then recombine part 1 with part 2. Again, for your use case the StringSplitter approach is less efficient, but if you needed to recombine part 1 with part 4 and then part 2, for example, you would need it.
-
- Newbie
- Posts: 3
- Joined: Thu Jul 24, 2025 7:20 pm
Re: Remove part of a file name
Thank you! This is good to know.