Felciano Posted September 16, 2021 Share Posted September 16, 2021 Hi folks -- Is there an Alfred workflows action or idiom for parsing a string into multiple variables? I'm trying to get something like "2014-09-15 - Wells Fargo - Monthly Statement - Account 1234.pdf" and extract out "Wells Fargo", "Monthly Statement", and "Account 1234" into separate variables. I know how to write the regex for this using groups, but I'm not clear if there is a way to have those groups end up in workflow variables that can then be passed on to subsequent steps in the workflow. Any guidance/tips for me? Thanks in advance! Link to comment
giovanni Posted September 16, 2021 Share Posted September 16, 2021 if they are always separate by the same character (e.g. '-') you can use the Split Argument to Variables utility. If you want to assign specific variable names you can add an Arguments and Variables utility Link to comment
deanishe Posted September 16, 2021 Share Posted September 16, 2021 It can be done, but will only work properly if there are never any dashes in the individual elements. giovanni 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now