Problems with text in Taker variables

227 views
Skip to first unread message

Gerald Duda

unread,
Oct 25, 2021, 8:51:31 AM10/25/21
to Tasker
Hi dear friends of Tasker.

I wonder if someone can help me.

I'm searching Text in a .txt file.
If i write "%text~*THOSS/WHEELDON/ROBBINS*" for exemplar, its not found although it is in the text file exactly like this.
If i write "%text~*THOSS/WHEELDON/*" its found.
If i write "%text~*THOSS/WHEELDON/R*" its not found again.

There are a some more letter combinations i can't find. They all have in common,that there are two or more slashes in it.
Can it be, that there are limitations for characters in variables?

Thanks for your help
Gerald

jmjc...@gmail.com

unread,
Oct 25, 2021, 10:20:37 AM10/25/21
to Tasker
If you want to match "THOSS" or "WHEELDON" or "ROBBINS" anywhere in %text, then the correct syntax is:

*THOSS*/*WHEELDON*/*ROBBINS*

Gerald Duda

unread,
Oct 25, 2021, 12:49:08 PM10/25/21
to Tasker
Thanks for your answer,  but this doesn't help me at all.
I don't want to find "THOSS" or "WHEELDON" or "ROBBINS", I want to find "THOSS/WHEELDON/ROBBINS". I'm not using the slashes as a wildcard. They are part of the text that I want to find.

Scott Miller

unread,
Oct 25, 2021, 1:19:57 PM10/25/21
to tas...@googlegroups.com
The / character in Tasker is an operator meaning OR. I don't believe you can match that using simple pattern matching. Try replacing the slash with a + which is a wildcard for one or more characters. Otherwise switch to regex matching.

Scott M.

--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tasker/9aff8334-432d-4876-a3c9-101d6fe4c68en%40googlegroups.com.

Gerald Duda

unread,
Oct 25, 2021, 3:42:32 PM10/25/21
to Tasker
That can't be the problem, because I can find even two slashes in text.
What I cannot find, is text after the second slash.

jmjc...@gmail.com

unread,
Oct 25, 2021, 9:48:29 PM10/25/21
to Tasker
Now that you have clarified, simply use Regex:

%text ~R  THOSS/WHEELDON/ROBBINS

Gerald Duda

unread,
Oct 26, 2021, 10:09:15 AM10/26/21
to Tasker


I'm afraid I'm missunderstood.
The thing is: I have text in a variable. This text comes from a calender. It is the title of a calander event. It changes everyday and could be any text. Actually it is always the Name of one of many Theater productions.

I search for this variable in a .txt file, that holds a list, in wich this production names and some additional information to it appear several times. I'm doing this, to look if the perfomance took place in the past and if yes get the additional Information, to Do things with it.

This is what i do since in the meantime about 10 years.

Now the problem is, if the text has slashes in it, like in "Bal BALANCHINE/NEUMEIER/ROBBINS" or "Bal TÄNZER/BILDER/SINFONIEN" or like already mentioned "Bal THOSS/WHEELDON/ROBBINS", it's not found.

As far as I know from the guidelines for variables in Tasker, there are no restrictions that would prohibit the use of expressions like the ones above.

Thanks again for help and information

jmjc...@gmail.com

unread,
Oct 26, 2021, 11:17:18 AM10/26/21
to Tasker
Did my suggestion not work for you?

OR you are just asking why yours doesn't work?

Gerald Duda

unread,
Oct 26, 2021, 12:12:45 PM10/26/21
to Tasker
I don't know how to make a regex for an expression I don't know.
My solution worked for a long time. Due to corona I don't know when it stopped working. I don't want to talk about a bug, because my knowledge is much too little, but in fact i think it is a bug.

So, yes you're right, I wish somebody could tell me, why my variables sometimes don't work anymore.

Thanks for your time anyway.

jmjc...@gmail.com

unread,
Oct 26, 2021, 8:22:01 PM10/26/21
to Tasker
Share your text files or the whole text here so that we can help you further. It is likely not a bug. With the full text, we can see how it is not working anymore.

jmjc...@gmail.com

unread,
Oct 26, 2021, 9:47:55 PM10/26/21
to Tasker
The matching statement you are using doesn't really do what you think it is doing. It may SEEM to work the way you want and it sometimes can give you that impression.

Objective:
You want to find "THOSS/WHEELDON/ROBBINS" anywhere in your file/variable.

What you are using:
#1: *THOSS/WHEELDON/ROBBINS* 
The slash character mean OR in Tasker. Therefore the statement means to match "*THOSS" OR "WHEELDON" OR "ROBBINS*"
"*THOSS" matches anything ending with THOSS
"WHEELDON" matches the word WHEELDON with nothing else
"ROBBINS*" matches starting with ROBBINS
This statement will ALWAYS NOT match what you want

#2: THOSS/WHEELDON/*
This statment will ALWAYS match. It is because it matches the word "THOSS" OR the word "WHEELDON" OR Anything (* means anything)
So, this will always return TRUE no matter what you have in your file

Gerald Duda

unread,
Oct 27, 2021, 1:36:35 AM10/27/21
to Tasker
Good morning,

I always thought operations happen outside a variable and the variable ist just what it is, espacially in an easy to use, nearly wysiwyg application like tasker.

Whatever, here is my textfile. 
What I do, is: I look for %textfile2 (the name of the show) to get %textfile3 (time in seconds) and then generate a %min, a %max and if possible a %median time from the data. 
| and € are the seperators in the array.

Thanks once more



Einstellzeit.txt

jmjc...@gmail.com

unread,
Oct 27, 2021, 3:18:16 AM10/27/21
to Tasker
No problem.

Do you want Tasker to read the file, and then calculate min, max, and average show time for every show in the file? Or ask for a show name from you to search?

Gerald Duda

unread,
Oct 27, 2021, 3:51:25 AM10/27/21
to Tasker
I do both. In the evening when I write my new line to the file, i search for this one show  and update calenderentries of the current week.  
Aside from that  I have a task wich goes through the calenderentries of the next 60days and updates them possibly.
.

jmjc...@gmail.com

unread,
Oct 27, 2021, 3:53:17 AM10/27/21
to Tasker
So, you have it all working already? Except for the show that has a slash in the name?

Gerald Duda

unread,
Oct 27, 2021, 4:21:35 AM10/27/21
to Tasker
Yes

Gerald Duda

unread,
Oct 27, 2021, 4:40:12 AM10/27/21
to Tasker
I don`t think it`s important but for safety, I use two plugins in this tasks. "Calender Task" to read and update the calender and "Spreadsheet Query" to read and update a Google sheet that has further informations of the  respective show.

jmjc...@gmail.com

unread,
Oct 27, 2021, 10:05:06 AM10/27/21
to Tasker
If that is the case, you need to use Regex instead of Simple Matching. If you need help, let me know.
Reply all
Reply to author
Forward
0 new messages