Find and Delete Lines Containing More Than x Number of Characters

44 views
Skip to first unread message

Bill Kochman

unread,
Apr 4, 2024, 4:42:18 PM4/4/24
to 'Holger Bartel' via BBEdit Talk
Hello Everyone,

The title says it all.

I need to delete all lines containing MORE than x number of characters.

How would I implement this?

Or how about if I want to delete lines containing LESS than x number of characters?

Thank you!

Kind regards,

Bill Kochman

Kevin Shay

unread,
Apr 4, 2024, 4:50:44 PM4/4/24
to bbe...@googlegroups.com
1) Text > Process Lines Containing...
2) Check the Grep checkbox
3) Use the following pattern to target all lines with 60 or more characters:

.{60,}

The "Delete matched lines" checkbox should let you do the deletion. Use "do not contain" for less instead of more characters.

Cheers,
Kevin

--
This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/DE9E9B3D-F73F-48EF-B56D-87BA5808F727%40gmail.com.

Bill Kochman

unread,
Apr 4, 2024, 5:11:50 PM4/4/24
to bbe...@googlegroups.com
Thank you very much, Kevin. Very helpful.

I tried something like that earlier, but it didn’t work. I guess I just didn’t get the syntax quite right.

Kind Regards,


graphical-email-signature-400x230.jpg

Reply all
Reply to author
Forward
0 new messages