Hi,
Is possible to count a specific characters in a string?
Exemple:
I have a path "C:\Users\cpirino\Desktop\Alocação\Arquivos alocados\SEMANA 32\20180806_08_34_24.txt" and I need the number of "\" in this path.
Att.
Solved! Go to Solution.
Hi,
There's two ways to do this. One uses Regex, one does not.
The Regex solution:
REGEX_CountMatches([Yourfield],'\\')
We include two "\" characters to escape the \ in REGEX. If I test this formula we get a total of 7 matches.
Non-REGEX
LENGTH([Yourfield])-LENGTH(REPLACE([Yoourfield],"\",""))
This option basically involves taking the original length of the field, and subtracting the length of the field if we delete all "\" characters. This also finds 7 matches.
Both of these will work, which you use is up to you.