Re: Removing part of a string

2020-11-15 Thread Howard
Thanks jem, your first solution is what I needed.



On Friday, 13 November 2020 at 1:53:33 pm UTC-5 Tim A wrote:

> Ah! Hiding in plain sight :>)
> Thanks.
>
> On Friday, November 13, 2020 at 9:37:51 AM UTC-8 Jan Erik Moström wrote:
>
>> On 13 Nov 2020, at 17:07, Tim A wrote: 
>>
>> > Curio. Both suggested Search patterns will also "see" themselves and 
>> > match in the three lines of text below. Why? 
>> > 
>> > 
>> > 
>> > 1956,ML,Don Newcombe\newcodo01,BRO,4.5,27,7,0,3.06,268.0,139 
>> > 
>> > \\.*?, 
>> > 
>> > \\[^,]+ 
>>
>> These patterns says 
>>
>> 1. Match any characters from a backslash until (and including) the first 
>> comma. All three lines match this 
>> 2. Match any characters that are not a common from a backslash. All 
>> lines match this also. 
>>
>> = jem 
>>
>

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/8952820d-d8de-486e-8f1b-ea661ed067e8n%40googlegroups.com.


Re: Removing part of a string

2020-11-13 Thread Tim A
Ah! Hiding in plain sight :>)
Thanks.

On Friday, November 13, 2020 at 9:37:51 AM UTC-8 Jan Erik Moström wrote:

> On 13 Nov 2020, at 17:07, Tim A wrote:
>
> > Curio. Both suggested Search patterns will also "see" themselves and 
> > match in the three lines of text below. Why?
> >
> >
> >
> > 1956,ML,Don Newcombe\newcodo01,BRO,4.5,27,7,0,3.06,268.0,139
> >
> > \\.*?,
> >
> > \\[^,]+
>
> These patterns says
>
> 1. Match any characters from a backslash until (and including) the first 
> comma. All three lines match this
> 2. Match any characters that are not a common from a backslash. All 
> lines match this also.
>
> = jem
>

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/3d9280b0-2e98-4199-980b-52da014bc4e0n%40googlegroups.com.


Re: Removing part of a string

2020-11-13 Thread Jan Erik Moström

On 13 Nov 2020, at 17:07, Tim A wrote:

Curio. Both suggested Search patterns will also "see" themselves and 
match in the three lines of text below. Why?




1956,ML,Don Newcombe\newcodo01,BRO,4.5,27,7,0,3.06,268.0,139

\\.*?,

\\[^,]+


These patterns says

1. Match any characters from a backslash until (and including) the first 
comma. All three lines match this
2. Match any characters that are not a common from a backslash. All 
lines match this also.


= jem

--
This is the BBEdit Talk public discussion group. If you have a feature request or need 
technical support, please email "supp...@barebones.com" rather than posting here. 
Follow @bbedit on Twitter: 
--- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/82209665-97FE-4EB7-AEC1-C31891CE2E4B%40mostrom.pp.se.


Re: Removing part of a string

2020-11-13 Thread Tim A
Curio. Both suggested Search patterns will also "see" themselves and match 
in the three lines of text below. Why?

1956,ML,Don Newcombe\newcodo01,BRO,4.5,27,7,0,3.06,268.0,139
\\.*?,
\\[^,]+


On Friday, November 13, 2020 at 6:33:34 AM UTC-8 Robin Beech wrote:

> grep search for 
>
> \\[^,]+
>
> and replace with nothing
>
>
> On Friday, November 13, 2020 at 8:27:05 AM UTC-5 Howard wrote:
>
>> I have a dataset with a number of lines of data like this one:
>>
>> *1956,ML,Don Newcombe\newcodo01,BRO,4.5,27,7,0,3.06,268.0,139*
>>
>> In each line, in its third entry (in the above it is *Don 
>> Newcombe\newcodo01*) I want to remove everything from the backslash up 
>> to but not including its ending comma, so for the above line the output 
>> would be this: 
>>
>> *1956,ML,Don Newcombe,BRO,4.5,27,7,0,3.06,268.0,139*
>>
>> How can I do that?
>>
>> Thanks,
>> Howard
>>
>>

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/d42c68f4-fc62-4d88-a11f-775f85d86ae4n%40googlegroups.com.


Re: Removing part of a string

2020-11-13 Thread Robin Beech
grep search for 

\\[^,]+

and replace with nothing


On Friday, November 13, 2020 at 8:27:05 AM UTC-5 Howard wrote:

> I have a dataset with a number of lines of data like this one:
>
> *1956,ML,Don Newcombe\newcodo01,BRO,4.5,27,7,0,3.06,268.0,139*
>
> In each line, in its third entry (in the above it is *Don 
> Newcombe\newcodo01*) I want to remove everything from the backslash up to 
> but not including its ending comma, so for the above line the output would 
> be this: 
>
> *1956,ML,Don Newcombe,BRO,4.5,27,7,0,3.06,268.0,139*
>
> How can I do that?
>
> Thanks,
> Howard
>
>

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/64b905b8-2ffa-45ed-9bfa-3f49cb55ac89n%40googlegroups.com.


Re: Removing part of a string

2020-11-13 Thread Jan Erik Moström
On 13 Nov 2020, at 14:27, Howard wrote:

> **1956,ML,Don Newcombe\newcodo01,BRO,4.5,27,7,0,3.06,268.0,139**

If there are no other places the backslash can appear the simplest would be

Search: \\.*?,
Replace: ,

or if it's always "\newcodo01"

Search: "\newcodo01" (grep search off)
Replace:

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/98F97231-B611-4FC0-8C4F-31C29A373488%40mostrom.pp.se.


Removing part of a string

2020-11-13 Thread Howard
I have a dataset with a number of lines of data like this one:

*1956,ML,Don Newcombe\newcodo01,BRO,4.5,27,7,0,3.06,268.0,139*

In each line, in its third entry (in the above it is *Don 
Newcombe\newcodo01*) I want to remove everything from the backslash up to 
but not including its ending comma, so for the above line the output would 
be this: 

*1956,ML,Don Newcombe,BRO,4.5,27,7,0,3.06,268.0,139*

How can I do that?

Thanks,
Howard

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/b281e5fe-276f-4bee-995c-5da651fd55a4n%40googlegroups.com.