ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

[IDEA] Notepad: Highlight all text after X number of characters/words

<< < (2/5) > >>

Ath:
My problem for now is 'how to make differences between real words and no words that are between spaces/quotes/point or comma terminated etc etc etc'
-KodeZwerg (February 28, 2021, 06:58 AM)
--- End quote ---

I'd replace all CR's and LF's with a space, then reduce any duplicate spaces to single space, trim leading and trailing spaces off and use one of these solutions (Depending on Delphi version used) to split the string into an array, then get the length of that array/list for the number of words.

KodeZwerg:
I do technical agree for such simplified seperation.

Programming language independent.

I was not clear enough with my examples.

Like "$ 1.99"
I examine char by char to get proper results.
"$" is a symbol, symbol count + 1
"1" is a number, check for more
"." reached seperator, due prior number check for more
"9" and "9" are a number, due prior number make a value out of it, so value counter + 1

That is all okay, problem begin when I do examine such
"Meet at 9.7 People join."
The 9.7 aint a value, its two values.

So your rule is okay for your needs  :Thmbsup:
For my training I do more and hassle around with it  :D

Thanks for your suggestion and links!  :-*

Ath:
The 9.7 aint a value, its two values.
-KodeZwerg (February 28, 2021, 08:05 AM)
--- End quote ---
That is dependent on the current Locale. For US locale it is a single number (with fraction) for DE/NL it's an invalid number (thousands separator but not long enough) or two numbers.

According to the specs, defined by vevola, it's better to only use space as a separator, and not care about letters, digits or special characters.

KodeZwerg:
The 9.7 aint a value, its two values.
-KodeZwerg (February 28, 2021, 08:05 AM)
--- End quote ---
That is dependent on the current Locale. For US locale it is a single number (with fraction) for DE/NL it's an invalid number (thousands separator but not long enough) or two numbers.-Ath (February 28, 2021, 09:33 AM)
--- End quote ---

Good point @Ath  :Thmbsup:, I do just not full agree. Sorry me.
Phrase was "meet at 9.7 ppl join"
You see, the dot seperates two sentences and is not meant as fraction seperator in that phrase.
I am aware what you mean with locale settings but that was not my intention, i do think international, my code also :p

Okay you wrote "or two numbers" and that is what i try to specify by code. Brain-cracker ^^

Atm i made it easy for myself by letting user jump through all found values with "use for all" switch.


Anyway, vic has now vevolas rule what simplify everything.

Excuse me for using this thread for my personal issue.

Ath:
Phrase was "meet at 9.7 ppl join"
You see, the dot seperates two sentences and is not meant as fraction seperator in that phrase.
-KodeZwerg (February 28, 2021, 10:44 AM)
--- End quote ---
That is a syntax error. After the period should either be a space or a new-line.
That's one of thre reasons I wrote:
replace all CR's and LF's with a space,
-Ath (February 28, 2021, 07:51 AM)
--- End quote ---
:)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version