Delete rest of line starting with some character (how?)

31 views
Skip to first unread message

Gauvins

unread,
Sep 4, 2019, 8:28:26 AM9/4/19
to BBEdit Talk
I often want to delete extraneous characters surrounding the value of interest. Can this be done in one fell swoop? 
My current workflow is to find/replace with tabs; copy/paste in a spreadsheet; copy the central column

ex: typical line contains +some text of interest-that I want to extract
[do your magic: remove up to + / delete from -]
some text of interest

Kerri Hicks

unread,
Sep 4, 2019, 8:37:25 AM9/4/19
to bbe...@googlegroups.com
If your description is comprehensive, you could try to find (with the grep switch turned on)

^(.*?)[+](.*?)[-](.*?)$

and replace with

\2

--Kerri

--
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 to the group.
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/2044fa86-0e61-4b63-b7ed-1d08cb5b8a98%40googlegroups.com.

Sam Hathaway

unread,
Sep 4, 2019, 8:37:26 AM9/4/19
to BBEdit Talk

Find: ^.*\+(.*)-.*$
Replace: \1
Grep: on

Christopher Stone

unread,
Sep 4, 2019, 8:45:39 AM9/4/19
to BBEdit-Talk
On 09/04/2019, at 07:28, Gauvins <gauv...@gmail.com> wrote:
I often want to delete extraneous characters surrounding the value of interest. Can this be done in one fell swoop?


Hey Gauvins,

Most likely.

Please provide one or more real-world examples.

Faux examples and descriptions generally fail to reveal nuances of of the task.

--
Best Regards,
Chris


Reply all
Reply to author
Forward
0 new messages