- AuthorPosts
- April 9, 2018 at 10:48 am #22956spirosParticipant
I have a Greek text with some English words and I want to filter the lines which begin with capital letter, how would I do that?
For example, in Find/Replace I would do\n[Ά-Ώ,A-Z]
with Match Case and Use Regular Expressions checked.
but if I select Regex in the filter the \n bit does not work.April 9, 2018 at 12:37 pm #22957Patrick CParticipantProvided I didn’t mess up, the following should do
^[Α-ΩA-Z].*$
Where
^
start of string (i.e. line)
followed by a character within[Α-ΩA-Z]
followed by any character (except newlines).
occurring zero or more times*
$
end of string (i.e. line)Let me know if it does or doesn’t work.
Cheers
Patrick
PS The full syntax would be
/^[Α-ΩA-Z].*$/gm
April 10, 2018 at 12:53 am #22959spirosParticipantThis did it for me
^[Α-ΩΆ-ΏA-Z]
(I had to add “Ά-Ώ” so that it would get capitals with accents too)
Is there a way to show the number of lines filtered?
April 10, 2018 at 5:11 am #22960Patrick CParticipantRegarding the number of lines filtered:
Option 1:
Use the “Word Count” plugin (Tools → Plug-ins → 9 WordCount)
Word count shows the total number of “Lines” and the “View Lines”, with the View Lines corresponding to the number of filtered lines.Option 2:
Hit ctrl+a to select all.
The status bar in the bottom right corner will then show the number of selected lines.April 10, 2018 at 6:36 am #22961spirosParticipantOption 1: Takes ages to load…
Option 2: always shows the total number of lines for FULL fileApril 10, 2018 at 10:27 am #22964Patrick CParticipantAs in the image:
Option 2:
Hit ctrl+a to select all lines, then the bottom right indicator shows the number of selected lines and the total number of lines.
Option 2 is fast in my case. There is one downside that Option 2 does add the last line to the count if it is blank.PS Regarding option 1:
Yes, sadly sluggish performance is the case for large files.April 10, 2018 at 10:47 am #22970spirosParticipantI am working with a 500.000 lines file and Option 2 apparently works (in my case does not work at all, see screen) if “Word Count” plugin is active, which means… very slow performance. It was dead slow even with a 30.000 lines file.
April 13, 2018 at 11:33 am #23016Yutaka EmuraKeymasterHi Patrick C,
Regarding Option 2, I am not sure what you mean by “There is one downside that Option 2 does add the last line to the count if it is blank.”
Can you please clarify this sentence?April 14, 2018 at 5:07 am #23021Patrick CParticipantHello Yutaka
I’ve now noticed, that word count does the same thing but the other way round.
What I basically meant is as follows:Case where the last line is not blank:
Results in ctrl-a finding 13+1 = 14 lines instead of 13; Word count finds 13 view lines
Case where the last line is blank:
Results in ctrl-a finding 13 lines; interestingly Word count finds 14 view lines
April 14, 2018 at 4:26 pm #23025Yutaka EmuraKeymasterI fixed the issue with the number of selected lines incorrectly displayed in the status bar and the Word Count plug-in.
I also optimized the Word Count plug-in for speed, but if you need to speed up the plug-in, you might want to remove unnecessary queries such as Widths.
Also, queries using regular expressions can take much longer time than others, so should be removed if unnecessary.
Thanks,April 28, 2018 at 1:48 am #23092Patrick CParticipantProbably Spiros already knows, but if not (hope you get notified of follow up replies to this post):
Yutaka’s new Character count plug in is super fast and its ‘view line’ field shows the number of lines filtered.
Thank you Yutaka!
And btw: Also thank you for the DirectWrite implementation – I absolutely love it, the text is crispy clean and Emojis now work great too. - AuthorPosts
- You must be logged in to reply to this topic.