Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Count words with Title Formatting (Read 956 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Count words with Title Formatting

I was looking for the same way as below to count words of a string using title formatting.

Here's the mp3tag way using the regexp fn.
Code: [Select]
$add($len($regexp(%publisher%,\w,)),1)

How would that be translated to TF'ing without the use of the regexp fn.

My idea was to count the whitespaces and add 1 to get the word count, but I can't seem to figure it out.

Thanks.


Re: Count words with Title Formatting

Reply #1
Take the length of the string to start with.
Then strip the spaces from the string with $replace
Then subtract the second value from the first to get the number of spaces.
Then add 1 to get how many words.

Something like...

Code: [Select]
$add($sub($len(%title%),$len($replace(%title%, ,))),1)

Re: Count words with Title Formatting

Reply #2
Something like...

Code: [Select]
$add($sub($len(%title%),$len($replace(%title%, ,))),1)
Seems so simple when you get the answer. I avoid them fns because I'm so used to using the regexp fn which negates the use of many of them.
When I do have your attention Marc, will there ever be one implemented in FB2K?
Thank you for the quick response.

Re: Count words with Title Formatting

Reply #3
It's no good asking me.  :)) I have nothing to do with foobar development.

Plenty of users here will have "developer" status under their usernames but that's because they provide 3rd party components for foobar or other audio tools discussed across the other sections of the forums. The only difference is that we can edit our posts freely whereas normal users are restricted to one hour after posting. This is typically useful for updating changelogs/links etc in the first post of some thread where you are sharing something.

Re: Count words with Title Formatting

Reply #4
Oh, I saw our name plenty on here and thought you were the dev. What's the dev's handle? kode54?

I noticed that alright, I made a post about translating iTunes stats to foobar2000 and wanted to edit it to fix a couple of things.
https://hydrogenaud.io/index.php/topic,114448.msg943185.html#msg943185


Re: Count words with Title Formatting

Reply #5
Peter is the foobar developer - https://hydrogenaud.io/index.php?action=profile;u=84

Just be aware that he never seems to respond to feature requests - not even to say definitely not!!! If you report serious bugs, he's usually quick to respond but other than that, I think he's mostly busy with the iOS/android versions of foobar because that's basically his day job after raising enough funds to do it full time whereas there is no income from the desktop version.

Re: Count words with Title Formatting

Reply #6
The Android app was the reason for me looking into FB2K and switching from iTunes.

Glad that happened. 

Seeing as there's no requests page, I'll just leave this here in the hope that he might see this or I might post a specific request for the regexp fn so it stands out and doesn't get lost.

Thanks again for the answer.