Re: Grep help?

2009-03-25 Thread Patrick James

Hi

Assuming each list element is on a new line as per your example I  
think that:



should select what is required.

There's no need for negative lookahead.

Above can be modified to include lists of more than one type, such a s  
 or  for example and if there are empty lines between list  
elements.

I hope this is of some assistance :)


Patrick

http://www.patrickjames.co.uk

On 25 Mar 2009, at 20:44, le...@gmail wrote:

>
> I know I can do this with a negative look-ahead something or other,
> but despite years and years of regexs, I do not grok that particular
> mechanism.
>
> I want to search for lists that contain at least 10 list items.
>
> 
>
>
> I got started on something, but it blew up when there where multiple
> lists.
>
> (?!()+){10,}... things fall apart quickly for me.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "supp...@barebones.com" 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Grep help?

2009-03-25 Thread Robert A. Rosenberg

At 21:22 + on 03/25/2009, Patrick James wrote about Re: Grep help?:

>Hi
>
>Assuming each list element is on a new line as per your example I 
>think that:
>
>
>
>should select what is required.

I am not up on my GREP but I have an impression that this might catch 
cases where there are more than one list and at least 10 LIs in total.
-- 


Robert A. Rosenberg

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "supp...@barebones.com" 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Grep help?

2009-03-26 Thread le...@gmail

On Mar 25, 2009, at 15:22, Patrick James  wrote:

> Assuming each list element is on a new line as per your example I
> think that:
>
> 
>
> should select what is required.
>
> There's no need for negative lookahead.

There is with multiple lists in the same file, which is where I run  
into trouble.
>>
>>
>>
>>
>>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "supp...@barebones.com" 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Grep help?

2009-03-26 Thread G. T. Stresen-Reuter

On Mar 26, 2009, at 7:53 AM, le...@gmail wrote:

>
> On Mar 25, 2009, at 15:22, Patrick James   
> wrote:
>
>> Assuming each list element is on a new line as per your example I
>> think that:
>>
>> 
>>
>> should select what is required.
>>
>> There's no need for negative lookahead.
>
> There is with multiple lists in the same file, which is where I run
> into trouble.

Small modification (haven't been following the thread so I may have  
missed something)...



Should now select at least one LI and at most 10 LI. Is that what you  
want?

Ted Stresen-Reuter


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "supp...@barebones.com" 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Grep help?

2009-03-26 Thread Seth Dillingham

On 3/25/2009, le...@gmail said:

>I know I can do this with a negative look-ahead something or 
>other,  but despite years and years of regexs, I do not grok 
>that particular  mechanism.
>
>I want to search for lists that contain at least 10 list items.

Try this:

(?s:<([uo]l)[^>]*>\s*(?>]*>.*?\s*){10,})

Seth


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "supp...@barebones.com" 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Grep help?

2009-03-26 Thread le...@gmail

On 26-Mar-2009, at 02:27, G. T. Stresen-Reuter wrote:
> 
>
> Should now select at least one LI and at most 10 LI. Is that what you
> want?

No.  I want all lists that contain 10 or more items.

On 26-Mar-2009, at 08:45, Seth Dillingham wrote:

> Try this:
>
> (?s:<([uo]l)[^>]*>\s*(?>]*>.*?\s*){10,})


That looks promising, but I fed it a test file containing three   
with the first having 13 items, the second 9 and the third 12.   
Nothing was matched.

---test file
12345678910111213123456789123456789101112
---test file

(and yes, this example file, though fugly and containing no real data,  
accurately reflects the types of lists I am having to deal with.   
Sometimes there is a  tag, and sometimes there is not, often  
there are no spaces or formatting at all, other times it's expanded  
out to the maximum amount



1

 


Of course, the actually files are large, contain a lot of other code,  
and multiple lists. Sometimes the data is in tables also, but I am  
confident that once I get the syntax down for the lists I will be able  
to modify it to grab the tables with more than 10 rows.

The tables are a wonder of bad html as they all fit the pattern:

1.Item 12.Item 2... etc

Yes, someone thought it would be cool to use a table to create an  
ordered list!

-- 
I want a refund, I want a light, I want a reason for all this night
after night after night after night


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "supp...@barebones.com" 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Grep help?

2009-03-26 Thread Pete

There is a great reference in BBEdit. Go to the Help Menu > BBEdit
Help. Once that opens, click on the Grep Reference link.

I think this might help you out though ...
(\r?){10,}

On Mar 26, 6:44 am, "le...@gmail"  wrote:
> I know I can do this with a negative look-ahead something or other,  
> but despite years and years of regexs, I do not grok that particular  
> mechanism.
>
> I want to search for lists that contain at least 10 list items.
>
> 
>
>
> I got started on something, but it blew up when there where multiple  
> lists.
>
> (?!()+){10,}... things fall apart quickly for me.
>
> --
> No matter how fast light travels it finds the darkness has always
>         go there first, and is waiting for it.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "supp...@barebones.com" 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Grep help?

2009-03-26 Thread Ronald J Kimball

On Thu, Mar 26, 2009 at 09:57:30AM -0600, le...@gmail wrote:
> 
> On 26-Mar-2009, at 08:45, Seth Dillingham wrote:
> 
> > Try this:
> >
> > (?s:<([uo]l)[^>]*>\s*(?>]*>.*?\s*){10,})
> 
> 
> That looks promising, but I fed it a test file containing three   
> with the first having 13 items, the second 9 and the third 12.   
> Nothing was matched.

> Sometimes there is a  tag, and sometimes there is not, often  
  ^^
> there are no spaces or formatting at all, other times it's expanded  
> out to the maximum amount

That's a very important detail.  Seth's regex assumes that there will
always be a  tag.  Here's a slightly modified version that uses a
positive lookahead to allow for a missing  tag:

(?s:<([uo]l)[^>]*>\s*(?>]*>.*?(?:\s*|(?=)

Ronald

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "supp...@barebones.com" 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Grep help?

2009-03-26 Thread le...@gmail

On 26-Mar-2009, at 10:42, Ronald J Kimball wrote:
> (?s:<([uo]l)[^>]*>\s*(?>]*>.*?(?:\s*|(?=)


In my test data that only matches against the third list.

---test file
12345678910111213123456789123456789101112
---test file

-- 
Hey kids, shake it loose together the spotlight's hitting something
That's been known to change the weather we'll kill the fatted
calf tonight So stick around you're gonna hear electric music:
Solid walls of sound


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "supp...@barebones.com" 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Grep help?

2009-03-26 Thread Ronald J Kimball

On Thu, Mar 26, 2009 at 12:39:44PM -0600, le...@gmail wrote:
> 
> On 26-Mar-2009, at 10:42, Ronald J Kimball wrote:
> > (?s:<([uo]l)[^>]*>\s*(?>]*>.*?(?:\s*|(?=)
> 
> In my test data that only matches against the third list.
> 
> ---test file
> 123456 li>78910111213 ol>123456789 li>123456789 li>101112
> ---test file
> 

It works fine for me in Perl.  There's no substantive difference between
your first list and your third list.  Are you sure you're searching the
whole file?

Ronald

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "supp...@barebones.com" 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Grep help?

2009-03-26 Thread Jonathan Lundell

On Mar 26, 2009, at 11:39 AM, le...@gmail wrote:

> On 26-Mar-2009, at 10:42, Ronald J Kimball wrote:
>> (?s:<([uo]l)[^>]*>\s*(?>]*>.*?(?:\s*|(?=)
>
>
> In my test data that only matches against the third list.
>
> ---test file
> 123456 li>78910111213 ol>123456789 li>123456789 li>101112
> ---test file

It matches the first and third for me.



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "supp...@barebones.com" 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Grep help?

2009-03-26 Thread le...@gmail


On 26-Mar-2009, at 12:52, Ronald J Kimball wrote:

>
> On Thu, Mar 26, 2009 at 12:39:44PM -0600, le...@gmail wrote:
>>
>> On 26-Mar-2009, at 10:42, Ronald J Kimball wrote:
>>> (?s:<([uo]l)[^>]*>\s*(?>]*>.*?(?:\s*|(?=)
>>
>> In my test data that only matches against the third list.
>>
>> ---test file
>> 123456> li>78910111213> ol>123456789> li>123456789> li>101112
>> ---test file
>>
>
> It works fine for me in Perl.  There's no substantive difference  
> between
> your first list and your third list.  Are you sure you're searching  
> the
> whole file?

Yes.  Results of Find all

http://home.kreme.com/grepresult.png

If I split it all up into mcultiple lines, then the match works.  All  
one line (like if the source had been saved in 'compact' mode) and it  
fails.


-- 
Amazingly Beautiful Creatures Dancing Excites the Forest
Glade, in my Heart how I do Jump like the Kudo Listen to the
Music so Nice the Organ Plays. Quietly Rests the Sleepy
Tiger Under the Vine tree at the Water's side and X marks
the spot 'neath the Yellow moon where the Zulu king and
I did hide.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "supp...@barebones.com" 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Grep help?

2009-03-26 Thread Jonathan Lundell

On Mar 26, 2009, at 1:48 PM, le...@gmail wrote:

> Yes.  Results of Find all
>
> http://home.kreme.com/grepresult.png
>
> If I split it all up into mcultiple lines, then the match works.  All
> one line (like if the source had been saved in 'compact' mode) and it
> fails.

Looks like your reformatter messed it up. I don't think you can have  
white space after the / in , for example. Does your file validate?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "supp...@barebones.com" 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Grep help?

2009-03-26 Thread Ronald J Kimball

On Thu, Mar 26, 2009 at 02:48:55PM -0600, le...@gmail wrote:
> 
> 
> On 26-Mar-2009, at 12:52, Ronald J Kimball wrote:
> 
> >
> > On Thu, Mar 26, 2009 at 12:39:44PM -0600, le...@gmail wrote:
> >>
> >> On 26-Mar-2009, at 10:42, Ronald J Kimball wrote:
> >>> (?s:<([uo]l)[^>]*>\s*(?>]*>.*?(?:\s*|(?=)
> >>
> >> In my test data that only matches against the third list.

> Yes.  Results of Find all
> 
> http://home.kreme.com/grepresult.png
> 
> If I split it all up into mcultiple lines, then the match works.  All  
> one line (like if the source had been saved in 'compact' mode) and it  
> fails.

That looks like it matched the first list, not the third one...

Anyway, I can't explain why it's not working for you.

Ronald

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "supp...@barebones.com" 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Grep help?

2009-03-26 Thread le...@gmail

On 26-Mar-2009, at 15:04, Jonathan Lundell wrote:
> On Mar 26, 2009, at 1:48 PM, le...@gmail wrote:
>> Yes.  Results of Find all
>>
>> http://home.kreme.com/grepresult.png
>>
>> If I split it all up into mcultiple lines, then the match works.  All
>> one line (like if the source had been saved in 'compact' mode) and it
>> fails.
>
> Looks like your reformatter messed it up. I don't think you can have
> white space after the / in , for example. Does your file  
> validate?

This data is certainly not going to validate.  But there is no  
whitespace at all on that line.  you are seeing BBEdits softwrap  
(check the line numbers on the left)

-- 
No one ever thinks of themselves as one of Them. We're always one
of Us. It's Them that do the bad things.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "supp...@barebones.com" 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Grep help?

2009-03-26 Thread Jonathan Lundell

On Mar 26, 2009, at 3:00 PM, le...@gmail wrote:

> On 26-Mar-2009, at 15:04, Jonathan Lundell wrote:
>> On Mar 26, 2009, at 1:48 PM, le...@gmail wrote:
>>> Yes.  Results of Find all
>>>
>>> http://home.kreme.com/grepresult.png
>>>
>>> If I split it all up into mcultiple lines, then the match works.   
>>> All
>>> one line (like if the source had been saved in 'compact' mode) and  
>>> it
>>> fails.
>>
>> Looks like your reformatter messed it up. I don't think you can have
>> white space after the / in , for example. Does your file
>> validate?
>
> This data is certainly not going to validate.  But there is no
> whitespace at all on that line.  you are seeing BBEdits softwrap
> (check the line numbers on the left)

Curious. Here's my version, using the Compact format option.

http://web.me.com/jlundell/filechute/BBEditScreenSnapz001.jpg

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "supp...@barebones.com" 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Grep help?

2009-03-26 Thread Seth Dillingham

On 3/26/2009, Ronald J Kimball said:

>> Sometimes there is a  tag, and sometimes there is not, often
>^^
>>  there are no spaces or formatting at all, other times it's 
>>expanded   out to the maximum amount
>
>That's a very important detail.  Seth's regex assumes that there will
>always be a  tag.  Here's a slightly modified version that uses a
>positive lookahead to allow for a missing  tag:
>
>(?s:<([uo]l)[^>]*>\s*(?>]*>.*?(?:\s*|(?=)

Yeah I think my regex was perfect for the problem as first 
described. This little detail would have been helpful (or would 
have let me be more helpful).

Just catching up, I got a big load of messages from the list all 
at once.

Seth


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "supp...@barebones.com" 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Grep help?

2009-03-27 Thread le...@gmail

On 26-Mar-2009, at 19:54, Seth Dillingham wrote:
> On 3/26/2009, Ronald J Kimball said:
>
>>> Sometimes there is a  tag, and sometimes there is not, often
>> ^^
>>> there are no spaces or formatting at all, other times it's
>>> expanded   out to the maximum amount
>>
>> That's a very important detail.  Seth's regex assumes that there will
>> always be a  tag.  Here's a slightly modified version that  
>> uses a
>> positive lookahead to allow for a missing  tag:
>>
>> (?s:<([uo]l)[^>]*>\s*(?>]*>.*?(?:\s*|(?=)
>
> Yeah I think my regex was perfect for the problem as first
> described. This little detail would have been helpful (or would
> have let me be more helpful).

Well, I never included  tags in the example data...

I'm still puzzled why the match only gets the second list if  
everything is compacted onto a single line, but I have to assume that  
is some BBEdit8 weirdness as it works with sed just fine, and I will  
probably end up processing the files from a shell script anyway.   
Thanks for everyone's help.



-- 
 From deep inside the tears that I'm forced to cry
 From deep inside the pain I--I chose to hide


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "supp...@barebones.com" 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: grep help

2009-05-13 Thread Patrick Woolsey

"Ze'ev"  sez:

>I'm trying to clean up a bunch of vcards.
>
>After various synchs, I have repeated information in my notes field,
>e.g.:
>
>NOTE:blabla\nJim's guy\n\numesh\nJim's guy\n\numesh\nunique\nJim's guy
>\n\numesh\nJim's guy\n\numesh\n\nJim's guy\n\numesh\nJim's guy\n\numesh
>\nJim's guy\n\numesh\nJim's guy\n\numesh
>
>I want to end up with
>
>NOTE:blabla\nJim's guy\n\numesh\nunique\n
>
>I'm trying to write a grep expression that will eliminate all the
>repeated text.


Sorry, no way to tell without more info about the structure of the note
contents, or some actual data.


Regards,

 Patrick Woolsey
==
Bare Bones Software, Inc.
P.O. Box 1048, Bedford, MA 01730-1048

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "supp...@barebones.com" 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: grep help

2009-05-13 Thread Ronald J Kimball

On Wed, May 13, 2009 at 09:12:39AM -0700, Ze'ev wrote:
> 
> Any grep wizards out there?
> 
> I'm trying to clean up a bunch of vcards.
> 
> After various synchs, I have repeated information in my notes field,
> e.g.:
> 
> NOTE:blabla\nJim's guy\n\numesh\nJim's guy\n\numesh\nunique\nJim's guy
> \n\numesh\nJim's guy\n\numesh\n\nJim's guy\n\numesh\nJim's guy\n\numesh
> \nJim's guy\n\numesh\nJim's guy\n\numesh
> 
> I want to end up with
> 
> NOTE:blabla\nJim's guy\n\numesh\nunique\n
> 
> 
> I'm trying to write a grep expression that will eliminate all the
> repeated text.
> 
> I've tried replacing
> 
> NOTE:(.*?)(.*?)(.*)\2

In your regex:

(.*?)(.*?)(.*)\2

the first two parenthesized groups will always match zero characters.  .*?
means match any number of characters, but as few as possible.

Suppose you're matching against this string:

Hello, world!

The first (.*?) will match zero characters at the start of the string.  The
second (.*?) will match at the same position.  The (.*) will match the
whole string.  The \2 will match the same thing that the second (.*?)
matched, which was zero characters.

I hope that helps somewhat.  As Patrick said, it would be helpful to have
more detailed information about the source data.

Ronald

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "supp...@barebones.com" 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: grep help

2009-05-14 Thread Ze'ev

Here's some sample lines:

NOTE:r 307072427\na 0014017578\n\nr 307072427\na 0014017578\nr
307072427\na 0014017\n

NOTE:17 -2nd place (clinton-henry) 0D\nF\: carroll st fr\n\n17 -2nd
place (clinton-henry)

NOTE:Mailing Address\:\nBroadVoice\, Inc.\nPO Box 10\nBi\n\nMailing
Address\:\nBroadVoi\n\nMailing Address\:\nBroadVoice\, Inc.\nPO Box
10\nBi\n\nMailing Address\:\nBroadVoice\, Inc.\nPO Box 10\nBi\n

(Each vcard's 'note' field is on its own line starting with 'NOTE:',
and the \n's get converted to line feeds in Address Book.)

The repeats seem to always have at least one \n between them.

My latest effort is to search for:
(NOTE:.*?)(.+?)((?:\\n)+)\2

and replace with:
\1\2\3

... and this actually works, but it takes MULTIPLE passes (and leaves
me with extra \n's which are easy enough to get rid of afterwards)

Anyway to improve this?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "supp...@barebones.com" 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Grep Help

2010-01-17 Thread Kendall Conrad
This seems to work:

([\s\S]*?

-Kendall

On Jan 17, 2:42 pm, Warren Michelsen  wrote:
> I need to search for a  tag set and everything in between, which may 
> include line breaks but which must include an anchor.
>
>             
>                                     http://URL.WILL.BE.HERE";>Link 
> Text here
>                             
>
> I need to find and replace this entire table column. (Replacing with "" so as 
> to delete.)
>
> What's the Grep pattern to find this?
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.

Re: Grep Help

2010-01-17 Thread Ronald J Kimball
On Sun, Jan 17, 2010 at 12:10:57PM -0800, Kendall Conrad wrote:
> This seems to work:
> 
> ([\s\S]*?

Unfortunately, that won't work.  It will match across td tags to find an
anchor tag.  For example, it will match:

text

You need to prevent the first [\s\S]*? from matching .

Try this instead:
(?s)((?:(?!).)*?


Note that . in the presence of (?s) is equivalent to [\s\S].  They both
work, I just happen to prefer the former.

Ronald
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.

Re: Grep Help

2010-01-17 Thread Garth Fletcher

Warren Michelsen wrote:

I need to search for a  tag set and everything in between, which may 
include line breaks but which must include an anchor.



I use:

(?s)(.+?)

 where:
  (?s) = search across end of lines
   .+? = non-greedy match to anything
--
Garth Fletcher

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.

Re: Grep Help.

2010-09-09 Thread Bruce Van Allen

On 2010-09-09, m i l e s wrote:


Hi.

I have data from a OUTLOOK export that's been corrupted.  It 
appears that Outlook is putting extraneous data from the NOTES 
field into the TITLE field of the export, which ends up column 
shifting the resulting records that follow the first record.


Look at the sample data below: its column shifted the following:
"  Low Normal  Web Page

Down to the next line, and anything in the notes field gets stuffed
into the Title field, where there should be nothing at all.

How would I fix this with Grep ?


It's difficult to see the problem because email has broken your 
lines up.


A few things to try:

1. First, If you can go back to Outlook and re-do the export, 
pay attention to any options for line breaks, encoding, etc. 
Also, when there, see if this record has anything odd in it, 
such as extraneous quote marks, paragraph returns, etc.


2. Open the exported file in BBEdit with various encodings (see 
File menu "Re-Open with Encoding". Might reveal something.


3. Viewing the file in BBEdit, choose Show Invisibles, and look 
for strange characters (sometimes shown as red upside-down 
question marks), etc). If they seem to be located near the 
problems, you might get somewhere by searching for them and 
deleting or replacing with something that doesn't force a new line.


HTH -- Just guessing



   - Bruce

_bruce__van_allen__santa_cruz_ca_

--
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.

To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.

Follow @bbedit on Twitter: 


Re: Grep Help.

2010-09-09 Thread Doug McNutt
At 11:09 -0700 9/9/10, Bruce Van Allen wrote:
>On 2010-09-09, m i l e s wrote:
>
>>I have data from a OUTLOOK export that's been corrupted.  It appears that 
>>Outlook is putting extraneous data from the NOTES field into the TITLE field 
>>of the export, which ends up column shifting the resulting records that 
>>follow the first record.
>>
>>Look at the sample data below: its column shifted the following:
>>"  Low Normal  Web Page
>>
>>Down to the next line, and anything in the notes field gets stuffed
>>into the Title field, where there should be nothing at all.
>>
>>How would I fix this with Grep ?
>
>It's difficult to see the problem because email has broken your lines up.
>
>A few things to try, snipped by DPM
>

Another thing to try:

Select the lines you posted, or a more original source, and paste them into a 
spreadsheet. Excel, for instance, recognizes the tabs and will place items in 
columns across the page. BBEdit  offers no way to do that.

When I did that I found missing tabs with "135 Lexington Avenue" coming under 
"Job  Title" instead of "Business Street".

It's as if someone was adjusting the tabs so that the format would look right 
in his text-oriented display. Converting tabs to spaces could do that and 
create a terrible mess.

Using Excel's "insert cells" command it's possible to line some things up with 
what BBEdit would think are inserted tabs but you'd be guessing based on 
content and that's hard to automate. With a lot more items you might see usable 
patterns with the real column structure offered by a spreadsheet.

The Jack Hirsch item seems totally unrelated to the headings. It appears on a 
row by itself. The other items have nothing in the Title, column 1.

With all of those columns, mostly blank, you have a pretty good example of what 
xml files are for.

-- 
--> Give me liberty or give me Obamacare <--

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: Grep Help.

2010-09-10 Thread Chaz Larson
I dealt with this a lot recently in another context.  Your file is not
corrupted.  Some fields just contain end-of-line characters.  For
example, the "notes' field in Joan Fink's record contains:

Edward assistant[nl]
427-6119[nl]
562-0176

and the "notes" field in Aron Maure's record contains:

Jeff Masone[nl]
[nl]
Jack Hirsch, came from ICAA, since Oct 08[nl]

Where "[nl]" is a end-of-line [someone hit the return key while
entering the data in the "notes" field.  So, the data is exported just
as it "should be", in that what you're seeing is what's stored in the
source.

I can think of a few ways to clean this up, but I'd like to know more
about the data set.  Does every line end with a "http://foo.bar.baz";?

chazl

Chaz Larson - c...@jeck.com



On Thu, Sep 9, 2010 at 9:21 AM, m i l e s  wrote:
> Hi.
>
> I have data from a OUTLOOK export that's been corrupted.  It appears that 
> Outlook is putting extraneous data from the NOTES field into the TITLE field 
> of the export, which ends up column shifting the resulting records that 
> follow the first record.
>
> Look at the sample data below: its column shifted the following:
>
> "       Low             Normal          Web Page
>
> Down to the next line, and anything in the notes field gets stuffed into the 
> Title field, where there should be nothing at all.
>
> How would I fix this with Grep ?
>
> ==
>              Columns
> ==
>
> Title   First Name      Middle Name     Last Name       Suffix  Company 
> Department      Job Title       Business Street "Business Street 2"     
> "Business Street 3"     Business City   Business State  Business Postal Code  
>   Business Country/Region Home Street     "Home Street 2" "Home Street 3" 
> Home City       Home State      Home Postal Code        Home Country/Region   
>   Other Street    "Other Street 2"        "Other Street 3"        Other City  
>     Other State     Other Postal Code       Other Country/Region    
> Assistant's Phone       Business Fax    Business Phone  "Business Phone 2"    
>   Callback        Car Phone       Company Main Phone      Home Fax        
> Home Phone      "Home Phone 2"  ISDN    Mobile Phone    Other Fax       Other 
> Phone     Pager   Primary Phone   Radio Phone     TTY/TDD Phone   Telex   
> Account Anniversary     Assistant's Name        Billing Information     
> Birthday        Business Address PO Box Categories      Children        
> Directory Server        E-mail Address  E-mail Type     E-mail Display Name   
>   E-mail 2 Address        E-mail 2 Type   E-mail 2 Display Name   E-mail 3 
> Address        E-mail 3 Type   E-mail 3 Display Name   Gender  Government ID 
> Number    Hobby   Home Address PO Box     Initials        Internet Free Busy  
>     Keywords        Language        Location        Manager's Name  Mileage 
> Notes   Office Location Organizational ID Number        Other Address PO Box  
>   Priority        Private Profession      Referred By     Sensitivity     
> Spouse  "User 1"        "User 2"        "User 3"        "User 4"        Web 
> Page
>
> ===
>               Sample Data
> ===
>
>        Joan            Fink            The Dance Center                135 
> Lexington Avenue                    New York        NY      10128             
>                                                                               
>                                                 212)415  - Amy K. - 
> JF                                                                            
>                                                               0/0/00          
>         0/0/00                                  jf...@x.org     SMTP  
>                                                           Unspecified         
>                                                                             
> "Edward assistant
> 427-6119
> 562-0176"                               Low                             
> Normal                                          http://www.x.org
>
>        Maure           Aron            World Music/Crash Arts          
> Executive Director      720 Lindist Avenue                      Los Angeles   
>   CA      90007                                                               
>                                                                     
> 617/679.    617)876-                                                  
>                                                                               
>             0/0/00                  0/0/00                                  
> ma...@x.org     SMTP                                                  
>           Unspecified                                                         
>                             "Jeff Masone
>
> Jack Hirsch, came from ICAA, since Oct 08
> "                               Low                             Normal        
>            

Re: grep help

2011-10-23 Thread Marek Stepanek

On 05.01.2011 10:45 AM, Ken Lanxner wrote:

Hi.

How do I write a pattern to match a string that must contain 1 or more
tabs and may also contain 1 or more spaces --- in any order.

These would match:

tab
tab tab
tab space tab
space tab tab
tab space tab space

but a string of just 1 or more spaces would not match.

Thanks!

Ken




Hello Ken!


Try with this:

^(\t|\t\t|\t \t| \t\t|\t \t )$

Are these spaces alone in one line? If not remove ^ and $


marek

--
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.

To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.

Follow @bbedit on Twitter: 


Re: grep help

2011-10-23 Thread Neil Faiman
On Oct 23, 2011, at 4:45 AM, Ken Lanxner wrote:

> Hi.
> 
> How do I write a pattern to match a string that must contain 1 or more tabs 
> and may also contain 1 or more spaces --- in any order.

[ ]*\t[ /t]*

A mandatory tab, optionally preceded by a string of spaces, and optionally 
followed by a string of spaces and/or tabs.

Regards,

Neil Faiman

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: grep help

2011-10-23 Thread Ken Lanxner
ms...@podiuminternational.org (Marek Stepanek) wrote on  
10/23/11  3:38 AM



On 05.01.2011 10:45 AM, Ken Lanxner wrote:

Hi.

How do I write a pattern to match a string that must contain 1 or more
tabs and may also contain 1 or more spaces --- in any order.

These would match:

tab
tab tab
tab space tab
space tab tab
tab space tab space

but a string of just 1 or more spaces would not match.

Thanks!

Ken




Hello Ken!


Try with this:

^(\t|\t\t|\t \t| \t\t|\t \t )$

Are these spaces alone in one line? If not remove ^ and $


marek



Thanks, Marek. With  ^ and $ I get zero matches. Without them, I 
only match pairs of tab space, in that order. It fails to find 
space tab. And not at all for longer strings with multiple tabs 
and spaces.


Hmmm.

Ken

--
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.

To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.

Follow @bbedit on Twitter: 


Re: grep help

2011-10-23 Thread Ken Lanxner

neil.goo...@faiman.org (Neil Faiman) wrote on  10/23/11  3:41 AM


On Oct 23, 2011, at 4:45 AM, Ken Lanxner wrote:


Hi.

How do I write a pattern to match a string that must contain 1 or more

tabs and may also contain 1 or more spaces --- in any order.

[ ]*\t[ /t]*

A mandatory tab, optionally preceded by a string of spaces, and 
optionally followed by a string of spaces and/or tabs.


Regards,

Neil Faiman


Thanks for your help, Neil. That works to a point but it seems 
to match inconsistently. It doesn't grab longer strings such as 
space tab space tab space tab tab. And it even matched a single space.


Here is a typical line. I am hoping the spaces and tabs will 
remain intact when sending via Mailsmith.


September 24, 2009  NE  Douglas 3271--112008/09 4.01%   
9/24/09 $1,522.92   $0.00   $1,522.92   $0.00   $1,522.92   
$0.00   $1,522.92   128.82  759


OK. Now I am seeing additional spacing in BBEdit with no 
character designation. For example, there is space showing 
between "NE" and "Douglas" in BBEdit --  and there needs to be 
-- but when I show invisibles and show spaces, no character 
represents that space. Does that make sense? :-)


These lines are copied from an Excel document. Maybe I can 
export them in a way that will be easier for me to work with.


Thanks again.

Ken

--
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.

To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.

Follow @bbedit on Twitter: 


Re: grep help

2011-10-23 Thread Doug McNutt
At 12:23 -0700 10/23/11, Ken Lanxner wrote:
>ms...@podiuminternational.org (Marek Stepanek) wrote on  10/23/11  3:38 AM
>
>>On 05.01.2011 10:45 AM, Ken Lanxner wrote:
>>>Hi.
>>>
>>>How do I write a pattern to match a string that must contain 1 or more
>>>tabs and may also contain 1 or more spaces --- in any order.
>>>
>>>These would match:
>>>
>>>tab
>>>tab tab
>>>tab space tab
>>>space tab tab
>>>tab space tab space
>>>
>>>but a string of just 1 or more spaces would not match.
>>Try with this:
>>
>>^(\t|\t\t|\t \t| \t\t|\t \t )$
>
>Thanks, Marek. With  ^ and $ I get zero matches. Without them, I only match 
>pairs of tab space, in that order. It fails to find space tab. And not at all 
>for longer strings with multiple tabs and spaces.


These are so much fun...

[ \t]*?\t[ \t]*

any number of spaces or tabs, including none of them, followed, without being 
greedy, by a required tab and some more spaces or tabs.

whonoze?  All regular expressions are experimental and they often depend on the 
software reading them.

I worry about possibly making the second [ \t] not greedy. Ask Larry???
-- 

--> From the U S of A, the only socialist country that refuses to admit it. <--

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: grep help

2011-10-23 Thread Ken Lanxner

dougl...@macnauchtan.com (Doug McNutt) wrote on  10/23/11  12:50 PM


These are so much fun...

[ \t]*?\t[ \t]*

any number of spaces or tabs, including none of them, followed,
without being greedy, by a required tab and some more spaces or tabs.

whonoze?  All regular expressions are experimental and they often
depend on the software reading them.

I worry about possibly making the second [ \t] not greedy. Ask Larry???


Yay! Success with this one!

Thanks, Doug (and Neil and Marek).

Who's Larry?

Ken

--
Simple Lives Web Design
http://simplelives.com

--
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.

To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.

Follow @bbedit on Twitter: 


Re: grep help

2011-10-23 Thread Doug McNutt
At 12:56 -0700 10/23/11, Ken Lanxner wrote:
>Who's Larry?

Larry Wall is the originator of perl - Practical Extract and Report Language..  
Regular expressions were a whole lot less than they are now before his work.

D.
-- 

-->  Halloween  == Oct 31 == Dec 25 == Christmas  <--

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: grep help

2011-10-23 Thread Ken Lanxner

dougl...@macnauchtan.com (Doug McNutt) wrote on  10/23/11  8:25 PM


At 12:56 -0700 10/23/11, Ken Lanxner wrote:

Who's Larry?


Larry Wall is the originator of perl - Practical Extract and 
Report Language..  Regular expressions were a whole lot less 
than they are now before his work.


D.


Aha. I'm always learning something here. :-)

Ken


--
Simple Lives Web Design
http://simplelives.com

--
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.

To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.

Follow @bbedit on Twitter: 


Re: grep help

2011-10-24 Thread Ronald J Kimball
On Sun, Oct 23, 2011 at 01:50:08PM -0600, Doug McNutt wrote:
> These are so much fun...
> 
> [ \t]*?\t[ \t]*
> 
> any number of spaces or tabs, including none of them, followed, without being 
> greedy, by a required tab and some more spaces or tabs.
> 
> whonoze?  All regular expressions are experimental and they often depend on 
> the software reading them.
> 
> I worry about possibly making the second [ \t] not greedy. Ask Larry???

If you make the last thing in a regular expression non-greedy, then it
will always match nothing (in the case of *? or ??) or only once (in the
case of +?).

For example, if you have the text:

  ab

And you search for:

  a+b*?

Then it will match 'a'.

Ronald

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


RE: grep help

2012-03-26 Thread Rick Gordon
FIND:
(.?*)

CHANGE TO:
\1

--

On 3/26/12 at 12:23 PM -0700, JT wrote in a message entitled
"grep help":

>  I'm trying to replace the   in a long table with  using
>grep
>
>6-Grain   Flakes  .. to.. 6-
>Grain   Flakes
>
>i tried * .. to.. * to no
>avail
>
>there are over 100 rows ion this table
>
>
>
>6-Grain   Flakes
>1 cup
>3 3/8
>  
>   
>Almond   flour, toasted
>1 cup
>3 3/8
>  
>   
>Almonds,   sliced
>1/2 cup
>1 1/2
>  
>
>--
>You received this message because you are subscribed to the
>"BBEdit Talk" discussion group on Google Groups.
>To post to this group, send email to bbedit@googlegroups.com
>To unsubscribe from this group, send email to
>bbedit+unsubscr...@googlegroups.com
>For more options, visit this group at
>
>If you have a feature request or would like to report a problem,
>please email "supp...@barebones.com" rather than posting to the group.
>Follow @bbedit on Twitter: 


-- 
___

RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___

WWW:   http://www.shelterpub.com

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: grep help

2012-03-26 Thread Christopher Stone
On Mar 26, 2012, at 15:39, Rick Gordon wrote:
> FIND:
> (.?*)
__

Hey Rick,

Didn't you switch up your non-greedy modifier?

Find:

(.*?)

Replace:

\1

--
Best Regards,
Chris

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: grep help

2012-03-26 Thread Ronald J Kimball
On Mon, Mar 26, 2012 at 04:06:40PM -0500, Christopher Stone wrote:
> On Mar 26, 2012, at 15:39, Rick Gordon wrote:
> > FIND:
> > (.?*)
> __
> 
> Hey Rick,
> 
> Didn't you switch up your non-greedy modifier?
> 
> Find:
> 
> (.*?)
> 
> Replace:
> 
> \1

This regex will work on the sample text, which has the  and  on
the same line, and no other cells on that line.  In general, however, it
may match too much; it matches from  to the next ,
even with a  in between.  (e.g. )

To avoid that issue, you could use the below regex, which will not match a
 that is already closed with a , (and also can match
across multiple lines):

Find

(?s)((?>(?!).)*)

Replace

\1


Ronald

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: grep help

2012-03-26 Thread Rick Gordon
I sure did switch up my non-greedy modifier. Thanks for noticing.

--

On 3/26/12 at 4:06 PM -0500, Christopher Stone wrote in a message entitled
"Re: grep help":

>On Mar 26, 2012, at 15:39, Rick Gordon wrote:
>> FIND:
>> (.?*)
>__
>
>Hey Rick,
>
>Didn't you switch up your non-greedy modifier?
>
>Find:
>
>(.*?)
>
>Replace:
>
>\1
>
>--
>Best Regards,
>Chris
>
>--
>You received this message because you are subscribed to the
>"BBEdit Talk" discussion group on Google Groups.
>To post to this group, send email to bbedit@googlegroups.com
>To unsubscribe from this group, send email to
>bbedit+unsubscr...@googlegroups.com
>For more options, visit this group at
><http://groups.google.com/group/bbedit?hl=en>
>If you have a feature request or would like to report a problem,
>please email "supp...@barebones.com" rather than posting to the group.
>Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>


-- 
___

RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___

WWW:   http://www.shelterpub.com

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>


Re: GREP help

2012-04-16 Thread Ronald J Kimball
On Mon, Apr 16, 2012 at 10:54:55AM -0700, David wrote:
> I need some Grep help.
> 
> I need to remove this type of entry from a large file.
> 
> "No Fly List:
> 101508
> 100698
> 
> Other options"
> 
> 
> ignore the quotation marks, I added them to illustrate the start and
> end of the string.
> 
> Each six digit employee number begins with 1. Each line ends with a
> carriage return.
> 
> The problem for a newbie like me is that there may be one or twenty
> employee numbers, each on its own line, and I'm not sure how to handle
> that. There is no hard limit on the number of 1x numbers to search
> for between No Fly List:\r   and Other Options"

One line containing an employee number:

[ \t]*1\d{5}\r

One or more lines containing an employee number:

([ \t]*1\d{5}\r)+

:)


So, the complete pattern might look like this:

(?m)No Fly List:\r(\s*1\d{5}\r)+\rOther options


Ronald

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: GREP help

2012-04-16 Thread David
Ron,

Perfect! Thanks (again)!

Best regards,

David

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: grep help

2012-08-05 Thread Maarten Sneep

On 5 aug. 2012, at 06:20, Steven  wrote:

> I am trying to remove a date string from an SQL file.
> 
> I have ,'\d\d\d\d\-\d\d\-\d\d \d\d:\d\d:\d\d', as the string I wish to 
> replace with  ,   
> 
> It does not like that.
> 
> I assume I have to \- because - is a character grep uses

Your question is somewhat incomplete, but let me try. The question would 
improve if you give a sample of the string you are looking for ('2012-08-05 
15:53:08', with or without the quotes?), and a clear indication what it should 
be replaced with ('').

1) Make sure that 'grep' is checked in the find window.
2) Try '[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2} 
[[:digit:]]{2}:[[:digit:]]{2}:[[:digit:]]{2}' as the search string. 

   - [[:digit:]] is a character class that contains all digits. 
 I find this more readable than \d, but that would work too.
   - [[:digit:]]{4} searches for exactly 4 digits in a row. 
   - the rest are literals.

Hope this helps,

Maarten

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 





Re: grep help

2012-08-06 Thread Terje Bless
On Sun, Aug 5, 2012 at 6:20 AM, Steven  wrote:
> I am trying to remove a date string from an SQL file.
>
> I have ,'\d\d\d\d\-\d\d\-\d\d \d\d:\d\d:\d\d', as the string I wish to
> replace with  ,
>
> It does not like that.

What does "does not like that" mean? That it finds no matches? Or do
you see something that indicates an error?

> I assume I have to \- because - is a character grep uses

You should generally not need to escape the hyphen outside of
character classes (enclosed between [ and ]).

And to get help with this problem you really do need to provide an
example of the data you're trying to match against.

-link

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 





Re: grep help

2012-08-06 Thread Steven
As maarten guessed, I am trying to remove 560 instances of a date from an 
SQL file.   So I am looking for a way to grab everything from one comma to 
the other and including the quotes, all the numbers and dashes  and dots 
and replace it with one single comma,

Maarten's method didn't work either. It just goes beep and says not found.

On Monday, August 6, 2012 2:31:23 AM UTC-7, Terje Bless wrote:
>
> On Sun, Aug 5, 2012 at 6:20 AM, Steven  wrote: 
> > I am trying to remove a date string from an SQL file. 
> > 
> > I have ,'\d\d\d\d\-\d\d\-\d\d \d\d:\d\d:\d\d', as the string I wish to 
> > replace with  , 
> > 
> > It does not like that. 
>
> What does "does not like that" mean? That it finds no matches? Or do 
> you see something that indicates an error? 
>
> > I assume I have to \- because - is a character grep uses 
>
> You should generally not need to escape the hyphen outside of 
> character classes (enclosed between [ and ]). 
>
> And to get help with this problem you really do need to provide an 
> example of the data you're trying to match against. 
>
> -link 
>

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 





Re: grep help

2012-08-06 Thread Maarten Sneep
Hi,

On 6 aug. 2012, at 15:45, Steven  wrote:

> As maarten guessed, I am trying to remove 560 instances of a date from an SQL 
> file.   So I am looking for a way to grab everything from one comma to the 
> other and including the quotes, all the numbers and dashes  and dots and 
> replace it with one single comma,
> 
> Maarten's method didn't work either. It just goes beep and says not found.

You really need to provide us with an example. My crystal ball is working 
poorly right now.

Maarten

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 





Re: grep help

2012-08-06 Thread John Delacour

At 21:20 -0700 4/8/12, Steven wrote:



I am trying to remove a date string from an SQL file.

I have ,'\d\d\d\d\-\d\d\-\d\d \d\d:\d\d:\d\d', as the string I wish 
to replace with  ,


It does not like that.

I assume I have to \- because - is a character grep uses



The search pattern on the next line, with or without escaped hyphens:
,'\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d',

will find strings like this:

,'2012-08-08 22:22:22',

in a plain text file.

What is your difficulty?

JD


--
--
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.

To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.

Follow @bbedit on Twitter: 





Re: grep help

2012-08-06 Thread Bruce Van Allen

On 8/4/12 at 9:20 PM, katesglad...@gmail.com (Steven) wrote:


I am trying to remove a date string from an SQL file.


From an SQL database file? Are you searching for text directly 
in that type of file? Which SQL database management system are 
you using?


??


   - Bruce

_bruce__van_allen__santa_cruz_ca_

--
--
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.

To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.

Follow @bbedit on Twitter: 





Re: grep help

2012-08-07 Thread Steven
A sample line is INSERT INTO books (title, topic_id, description, 
date_aquired, book_id, pages, w_index, w_bibliography, pub_date, subtitle, 
w_illustration, w_maps)  VALUES('Humans', 14, 'Then end of the world, 
maybe, maybe not', '2009-01-01 10:52:39', 1, NULL, 0, 0, NULL, NULL, 0, 0);
and I want to remove the date field gone and replaced with a single comma

I am using ,'\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d',.This should work. 
  But for some reason it does not.  I have show invisibles on and it shows 
only one space between the date and the time, which is what I am using.

At first I assumed that the - had to be escaped.  It seems that  is not the 
case.

Thanks for the help.   I usually have very good luck with advice here.

On Saturday, August 4, 2012 9:20:02 PM UTC-7, Steven wrote:
>
> I am trying to remove a date string from an SQL file.
>
> I have ,'\d\d\d\d\-\d\d\-\d\d \d\d:\d\d:\d\d', as the string I wish to 
> replace with  ,   
>
> It does not like that.
>
> I assume I have to \- because - is a character grep uses
>
>
> Thanks
>

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 





Re: grep help

2012-08-07 Thread mmje
You have a missing space after the first comma:
>>, '\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d',<< instead of  
,'\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d',<


Le 7 août 2012 à 06:43, Steven a écrit :

> A sample line is INSERT INTO books (title, topic_id, description, 
> date_aquired, book_id, pages, w_index, w_bibliography, pub_date, subtitle, 
> w_illustration, w_maps)  VALUES('Humans', 14, 'Then end of the world, maybe, 
> maybe not', '2009-01-01 10:52:39', 1, NULL, 0, 0, NULL, NULL, 0, 0);
> and I want to remove the date field gone and replaced with a single comma
> 
> I am using ,'\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d',.This should work.   
> But for some reason it does not.  I have show invisibles on and it shows only 
> one space between the date and the time, which is what I am using.
> 
> At first I assumed that the - had to be escaped.  It seems that  is not the 
> case.
> 
> Thanks for the help.   I usually have very good luck with advice here.
> 
> On Saturday, August 4, 2012 9:20:02 PM UTC-7, Steven wrote:
> I am trying to remove a date string from an SQL file.
> 
> I have ,'\d\d\d\d\-\d\d\-\d\d \d\d:\d\d:\d\d', as the string I wish to 
> replace with  ,   
> 
> It does not like that.
> 
> I assume I have to \- because - is a character grep uses
> 
> 
> Thanks
> 
> -- 
> -- 
> You received this message because you are subscribed to the 
> "BBEdit Talk" discussion group on Google Groups.
> To post to this group, send email to bbedit@googlegroups.com
> To unsubscribe from this group, send email to
> bbedit+unsubscr...@googlegroups.com
> For more options, visit this group at
> 
> If you have a feature request or would like to report a problem, 
> please email "supp...@barebones.com" rather than posting to the group.
> Follow @bbedit on Twitter: 
>  
>  
>  

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 





Re: grep help

2012-08-07 Thread Steven
Thanks.  I sort of knew it was something ridiculous  that was causing the 
problem.   Now I shall hang my head in shame, I kiss your feet in gratitude 
and I am going to get all those records updated.  I was seriously thinking 
of doing it the hard way.

Data base migrations from Oracle or MySQL to TSQL (or the other direction) 
must be a seriously miserable process.   Even my tiny data base (200+ 
authors, 560+/_ titles) is unnecessarily brutal.

On Tuesday, August 7, 2012 5:50:37 AM UTC-7, Mic wrote:
>
> You have a missing space after the first comma:
> >>, '\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d',<< instead of 
>  >>,'\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d',<
>
>
> Le 7 août 2012 à 06:43, Steven a écrit :
>
> A sample line is INSERT INTO books (title, topic_id, description, 
> date_aquired, book_id, pages, w_index, w_bibliography, pub_date, subtitle, 
> w_illustration, w_maps)  VALUES('Humans', 14, 'Then end of the world, 
> maybe, maybe not', '2009-01-01 10:52:39', 1, NULL, 0, 0, NULL, NULL, 0, 0);
> and I want to remove the date field gone and replaced with a single comma
>
> I am using ,'\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d',.This should work. 
>   But for some reason it does not.  I have show invisibles on and it shows 
> only one space between the date and the time, which is what I am using.
>
> At first I assumed that the - had to be escaped.  It seems that  is not 
> the case.
>
> Thanks for the help.   I usually have very good luck with advice here.
>
> On Saturday, August 4, 2012 9:20:02 PM UTC-7, Steven wrote:
>>
>> I am trying to remove a date string from an SQL file.
>>
>> I have ,'\d\d\d\d\-\d\d\-\d\d \d\d:\d\d:\d\d', as the string I wish to 
>> replace with  ,   
>>
>> It does not like that.
>>
>> I assume I have to \- because - is a character grep uses
>>
>>
>> Thanks
>>
>
> -- 
> -- 
> You received this message because you are subscribed to the 
> "BBEdit Talk" discussion group on Google Groups.
> To post to this group, send email to bbedit@googlegroups.com
> To unsubscribe from this group, send email to
> bbedit+unsubscr...@googlegroups.com
> For more options, visit this group at
> 
> If you have a feature request or would like to report a problem, 
> please email "supp...@barebones.com" rather than posting to the group.
> Follow @bbedit on Twitter: 
>  
>  
>  
>
>
>

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 





Re: Grep help?

2013-02-20 Thread Kendall Conrad
I couldn't see a way to get a 100% solution with just one grep run, but 
this works for items that have two, but not when there's three. If you run 
the same regex replace all multiple times it will accommodate more than two.

Find:
((\w+_\d+_\d+).*\.jpg)(\r(\2(.*\.jpg)))

Replace with:
\1,\4

-Kendall


On Wednesday, February 20, 2013 8:47:14 PM UTC-5, Lorin Rivers wrote:
>
> Oh Mighty Ones, 
>
> I have a big list that looks something like this: 
> speedo_705494_001.jpg 
> speedo_7051210_418.jpg 
> speedo_7051210_418_bk.jpg 
> speedo_7051200_041.jpg 
> speedo_7051200_041_bk.jpg 
> speedo_7051200_041_bk_a.jpg 
> speedo_7050911_173.jpg 
> speedo_7050911_173_bk.jpg 
> speedo_7050804_001.jpg 
> speedo_7050804_001_bk.jpg 
> speedo_705032_001.jpg 
> speedo_705031_001.jpg 
>
> and I want to make it like this: 
> speedo_705494_001.jpg 
> speedo_7051210_418.jpg,speedo_7051210_418_bk.jpg 
> speedo_7051200_041.jpg,speedo_7051200_041_bk.jpg,speedo_7051200_041_bk_a.jpg 
>
> speedo_7050911_173.jpg,speedo_7050911_173_bk.jpg 
> speedo_7050804_001.jpg,speedo_7050804_001_bk.jpg 
> speedo_705032_001.jpg 
> speedo_705031_001.jpg 
>
>
> My brain is dead and I can't figure it out. 
>
> Anyone have a suggestion for a regex that will accomplish this? 
>
> Thanks! 
> -- 
> Lorin Rivers 
> Mosasaur: Killer Technical Marketing  
>  
> 512/203.3198 (m) 
>
>
>

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Grep help?

2013-02-20 Thread Oliver Taylor
On Feb 20, 2013, at 5:47 PM, Lorin Rivers  wrote:

> Oh Mighty Ones,
> 
> I have a big list that looks something like this:
> speedo_705494_001.jpg
> speedo_7051210_418.jpg
> speedo_7051210_418_bk.jpg
> speedo_7051200_041.jpg
> speedo_7051200_041_bk.jpg
> speedo_7051200_041_bk_a.jpg
> speedo_7050911_173.jpg
> speedo_7050911_173_bk.jpg
> speedo_7050804_001.jpg
> speedo_7050804_001_bk.jpg
> speedo_705032_001.jpg
> speedo_705031_001.jpg
> 
> and I want to make it like this:
> speedo_705494_001.jpg
> speedo_7051210_418.jpg,speedo_7051210_418_bk.jpg
> speedo_7051200_041.jpg,speedo_7051200_041_bk.jpg,speedo_7051200_041_bk_a.jpg
> speedo_7050911_173.jpg,speedo_7050911_173_bk.jpg
> speedo_7050804_001.jpg,speedo_7050804_001_bk.jpg
> speedo_705032_001.jpg
> speedo_705031_001.jpg
> 
> 
> My brain is dead and I can't figure it out.
> 
> Anyone have a suggestion for a regex that will accomplish this?

Search: \n(.+bk(_a)?.jpg)+
Replace: ,\1

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Grep help?

2013-02-21 Thread Kendall Conrad
I had to switch the \n to \r before that would work.

Nice approach to it.

-Kendall


On Thursday, February 21, 2013 12:49:46 AM UTC-5, Oliver Taylor wrote:
>
> On Feb 20, 2013, at 5:47 PM, Lorin Rivers > 
> wrote:
>
> Oh Mighty Ones,
>
> I have a big list that looks something like this:
> speedo_705494_001.jpg
> speedo_7051210_418.jpg
> speedo_7051210_418_bk.jpg
> speedo_7051200_041.jpg
> speedo_7051200_041_bk.jpg
> speedo_7051200_041_bk_a.jpg
> speedo_7050911_173.jpg
> speedo_7050911_173_bk.jpg
> speedo_7050804_001.jpg
> speedo_7050804_001_bk.jpg
> speedo_705032_001.jpg
> speedo_705031_001.jpg
>
> and I want to make it like this:
> speedo_705494_001.jpg
> speedo_7051210_418.jpg,speedo_7051210_418_bk.jpg
>
> speedo_7051200_041.jpg,speedo_7051200_041_bk.jpg,speedo_7051200_041_bk_a.jpg
> speedo_7050911_173.jpg,speedo_7050911_173_bk.jpg
> speedo_7050804_001.jpg,speedo_7050804_001_bk.jpg
> speedo_705032_001.jpg
> speedo_705031_001.jpg
>
>
> My brain is dead and I can't figure it out.
>
> Anyone have a suggestion for a regex that will accomplish this?
>
>
> Search: *\n(.+bk(_a)?.jpg)+*
> Replace: *,\1*
>

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Grep help?

2013-02-21 Thread Sumtingwong
Here is what I came up with, also going to need a couple of passes.  

On the first run:

Find: 

\.jpg\n(.*?\_bk\_?.+)

Replace with:

\.jpg,\1

On the second run:

Find:

\.jpg\n(.*?\_bk\_.+)

Replace with the same as the first one:

\.jpg,\1

Hope this works!

Cheers,

Spencer

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Grep help?

2013-02-21 Thread Oliver Taylor
On Feb 21, 2013, at 3:58 AM, Kendall Conrad  wrote:

> I had to switch the \n to \r before that would work.

\n and \r are interchangeable in 10.5+

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Grep help?

2013-02-22 Thread Rod Buchanan
On Feb 21, 2013, at 9:22 PM, Oliver Taylor wrote:

> On Feb 21, 2013, at 3:58 AM, Kendall Conrad  wrote:
> 
>> I had to switch the \n to \r before that would work.
> 
> \n and \r are interchangeable in 10.5+

Sure, now that I finally got myself trained to type '\r'. :)

-- 
Rod Buchanan

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Grep help

2014-02-17 Thread Christopher Stone
On Feb 17, 2014, at 18:44, Ted Burger  wrote:
> I have Excel created .csv files that I have to parse.
> 
> Excel has a "feature" where it incodes commas in a field by enclosing that 
> field with quotes.
> 
> This means that you might have rows that look like:
> a,b,",c",d,e
> ",",,,,","
> 
> So what I want to do is replace any comma that is enclosed within quotes with 
> a space.
__

Hey Ted,

Give this a try:

Find:

"([^,]+),([^,]+)"

Replace:

\1 \2

--
Best Regards,
Chris

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
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 post to this group, send email to bbedit@googlegroups.com.


Re: Grep help

2014-02-17 Thread Ronald J Kimball
On Mon, Feb 17, 2014 at 07:44:29PM -0500, Ted Burger wrote:
> Folks,
> 
> Thanks in advance, but I am struggling with  putting together a grep search.
> 
> I have Excel created .csv files that I have to parse.
> Excel has a "feature" where it incodes commas in a field by enclosing that 
> field with quotes.
> This means that you might have rows that look like:
> a,b,",c",d,e
> ",",,,,","
> So what I want to do is replace any comma that is enclosed within quotes with 
> a space.
> I could survive with just deleting the comma if that makes it easier.
> 
> I think this requires some look-ahead or look-behind, which is over my head.
> I will have to have a grep solution, no perl no shell, no applescript.

I'm curious, what is your ultimate goal?  I'm wondering if there may be
ways to achieve it without having to munge the data first.

By the way, if you have access to Excel, it would be trivial to do a
search/replace within Excel to replace commas with spaces.


Anyway, I think you would want something like this:

Find

(\"[^\",\r]*),([^\"\r]*\")(?=(?:,(?:[^\",\r]+|\"(?:[^\"\r]|\"\")*\"))*$)

Replace

\1 \2

The positive look-ahead matches any remaining fields to the end of the
line, to make sure the comma being replaced is within a field rather than
between fields.  It should properly handle quoted empty fields and fields
containing quotation marks (which are escaped by doubling, e.g. "abc""def").

This will only find the first comma in each field, so you'll need to run it
multiple times if a field can contain multple commas.

Ronald

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
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 post to this group, send email to bbedit@googlegroups.com.


Re: Grep help

2014-02-18 Thread Alan Truly
Another case to be wary of is if you have double quotes in your text. They 
are encoded in the CSV as 2 double quotes. 

So for example:

name story
George  He said, "Hello!"
JeffI agree with George

Would be encoded as:
"name","story"
"George","He said, ""Hello!"""
"Jeff","I agree with George"

In this scenario, Christopher's grep works, but Ronald's fails. CSV can be 
surprisingly difficult to work with since it overuses the comma and 
double-quote. Be careful when converting large files that whatever you try 
works in the odd cases. Also, consider whether newlines might be included 
with quotes. I have to move on to other work, so can't help further right 
now, but thought I should give you the warning to be careful.

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
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 post to this group, send email to bbedit@googlegroups.com.


Re: Grep help

2014-02-18 Thread Ted Burger
Ronald and others,

Thanks for the solutions.
I have folks uploading CSV files to a web server that I then have to parse the 
columns and rows on the server and populate a database.
When I asked for help here I also went back to the client and they agreed to do 
a find/replace to remove the commas from the spreadsheet before they upload the 
csv file.
I should be good to go with out having to do any munging.

Thanks,
Ted
***  Ted Burger  
t...@tobsupport.com  * www.tobsupport.com



On Feb 17, 2014, at 11:23 PM, Ronald J Kimball wrote:

> On Mon, Feb 17, 2014 at 07:44:29PM -0500, Ted Burger wrote:
>> Folks,
>> 
>> Thanks in advance, but I am struggling with  putting together a grep search.
>> 
>> I have Excel created .csv files that I have to parse.
>> Excel has a "feature" where it incodes commas in a field by enclosing that 
>> field with quotes.
>> This means that you might have rows that look like:
>> a,b,",c",d,e
>> ",",,,,","
>> So what I want to do is replace any comma that is enclosed within quotes 
>> with a space.
>> I could survive with just deleting the comma if that makes it easier.
>> 
>> I think this requires some look-ahead or look-behind, which is over my head.
>> I will have to have a grep solution, no perl no shell, no applescript.
> 
> I'm curious, what is your ultimate goal?  I'm wondering if there may be
> ways to achieve it without having to munge the data first.
> 
> By the way, if you have access to Excel, it would be trivial to do a
> search/replace within Excel to replace commas with spaces.
> 
> 
> Anyway, I think you would want something like this:
> 
> Find
> 
> (\"[^\",\r]*),([^\"\r]*\")(?=(?:,(?:[^\",\r]+|\"(?:[^\"\r]|\"\")*\"))*$)
> 
> Replace
> 
> \1 \2
> 
> The positive look-ahead matches any remaining fields to the end of the
> line, to make sure the comma being replaced is within a field rather than
> between fields.  It should properly handle quoted empty fields and fields
> containing quotation marks (which are escaped by doubling, e.g. "abc""def").
> 
> This will only find the first comma in each field, so you'll need to run it
> multiple times if a field can contain multple commas.
> 
> Ronald
> 
> -- 
> This is the BBEdit Talk public discussion group. If you have a 
> feature request or would like to report a problem, please email
> "supp...@barebones.com" rather than posting to the group.
> 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 post to this group, send email to bbedit@googlegroups.com.

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
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 post to this group, send email to bbedit@googlegroups.com.


Re: Grep help

2014-02-18 Thread Ronald J Kimball
On Mon, Feb 17, 2014 at 09:32:24PM -0800, Alan Truly wrote:
> Another case to be wary of is if you have double quotes in your text. They 
> are encoded in the CSV as 2 double quotes. 
> 
> So for example:
> 
> name story
> George  He said, "Hello!"
> JeffI agree with George
> 
> Would be encoded as:
> "name","story"
> "George","He said, ""Hello!"""
> "Jeff","I agree with George"
> 
> In this scenario, Christopher's grep works, but Ronald's fails.

I forgot to account for double quotes within the field containing the
comma.  Here's the fixed version:

(\"(?:[^\",\r]|\"\")*),((?:[^\"\r]|\"\")*\")(?=(?:,(?:[^\",\r]+|\"(?:[^\"\r]|\"\")*\"))*$)


Note that Christopher's grep does not account for enclosed double quotes at
all.  It happens to work on your sample input, but it turns
,"field"
into
""" "field


Ronald

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
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 post to this group, send email to bbedit@googlegroups.com.


Re: Grep help

2014-02-18 Thread Alan Truly
No offense meant Ronald. You obviously have a strong understanding of grep. 
There are just so many issues involved with CSV parsing that it is hard to 
catch all of the cases.
 

> Note that Christopher's grep does not account for enclosed double quotes 
> at 
> all.  It happens to work on your sample input, but it turns 
> ,"field" 
> into 
> """ "field 
>
>
> Ronald 
>

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
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 post to this group, send email to bbedit@googlegroups.com.


Re: Grep help

2014-05-13 Thread Neil Faiman
On May 13, 2014, at 4:51 AM, jgill  wrote:
> 
> I want to search for all the text within a ... 
> which is across multiple lines.
> 
> .*? doesn't work because . does not include line returns
> 
> Is there a way in BBEdit to force . to include returns or is there some other 
> way of doing this?

Put (?s) at the beginning of the search expression, thus:

(?s).*?

"s" is the pattern modifier, meaning "dot will match any character (including 
newline)".

See the BBEdit help, Searching with Grep, Advanced Grep Topics.

- Neil Faiman

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
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 post to this group, send email to bbedit@googlegroups.com.


Re: Grep help

2014-05-13 Thread jgill
Thank you Neil, that is just what I needed.

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
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 post to this group, send email to bbedit@googlegroups.com.


Re: Grep help

2017-10-08 Thread Roland Küffner
Although this is the BBEdit forum, I would recommend good 'ol "sed" from
the command line for this job. Something like this should work:

sed '/new.html

to do it on all files in the working directory:
find . -name '*.txt' -exec sed -i '' '/ wrote:

> I've taken over a project and have many many html files with strings like
> this:
>
> 
>
> I want to change all occurrences of a semi-colon within a url to something
> else, like &.
>
> I started with this search string:
>
> (href=\".*);(.*\"[ ,>])
>
> and this replacement string:
>
> \1\&\2
>
> The problem is it is only replacing one of the semi-colons (and oddly, to
> me, not the first one) and I'd like to replace all of them.
>
> Pointers would be appreciated.
>
> --
> This is the BBEdit Talk public discussion group. If you have a
> feature request or would like to report a problem, please email
> "supp...@barebones.com" rather than posting to the group.
> 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 post to this group, send email to bbedit@googlegroups.com.
> Visit this group at https://groups.google.com/group/bbedit.
>

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
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 post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Grep help

2017-10-09 Thread Lee Hinde
thanks.

On Sun, Oct 8, 2017 at 9:24 AM, Roland Küffner 
wrote:

> Although this is the BBEdit forum, I would recommend good 'ol "sed" from
> the command line for this job. Something like this should work:
>
> sed '/new.html
>
> to do it on all files in the working directory:
> find . -name '*.txt' -exec sed -i '' '/
> Or, less cryptic, open the file in vim. Here, the same command would be
> :/
> These examples replace every ":" with "&" only on lines that contain
> " - please adapt). And of course: try this on copies first - no guarantee,
> that command does not wreak havoc upon your files :-)
>
> To bring this back to BBEdit: It would be a nice addition if BBEdit's
> search window would someday get an additional "only search lines matching a
> pattern" functionality :-)
>
> Roland
>
> On Sat, Oct 7, 2017 at 12:05 AM, Lee Hinde  wrote:
>
>> I've taken over a project and have many many html files with strings like
>> this:
>>
>> 
>>
>> I want to change all occurrences of a semi-colon within a url to
>> something else, like &.
>>
>> I started with this search string:
>>
>> (href=\".*);(.*\"[ ,>])
>>
>> and this replacement string:
>>
>> \1\&\2
>>
>> The problem is it is only replacing one of the semi-colons (and oddly, to
>> me, not the first one) and I'd like to replace all of them.
>>
>> Pointers would be appreciated.
>>
>>
>

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
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 post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Grep help

2017-10-11 Thread @lbutlr
On Oct 6, 2017, at 4:05 PM, Lee Hinde  wrote:
> 
> 
> I want to change all occurrences of a semi-colon within a url to something 
> else, like &.
> 
> I started with this search string:
> 
> (href=\".*);(.*\"[ ,>])
> 
> and this replacement string:
> 
> \1\&\2

One issue is that what you are replacing is contained in what you want to 
replace WITH, so you need to replace the semicolons that aren't part of the 
'&' string.

You'll need to check the BBEdit manual on this, starting not he bottom of page 
187 of the 11.6 manual.

"Positional Assertions

Positional assertions “anchor” a pattern, without actually matching any 
characters."

(?http://www.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+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Grep help

2017-10-12 Thread Lee Hinde
Thanks. The sed example turned out to be recursive. Page 189 on the current
beta manual.

On Wed, Oct 11, 2017 at 1:15 PM, @lbutlr  wrote:

> On Oct 6, 2017, at 4:05 PM, Lee Hinde  wrote:
> > 
> >
> > I want to change all occurrences of a semi-colon within a url to
> something else, like &.
> >
> > I started with this search string:
> >
> > (href=\".*);(.*\"[ ,>])
> >
> > and this replacement string:
> >
> > \1\&\2
>
> One issue is that what you are replacing is contained in what you want to
> replace WITH, so you need to replace the semicolons that aren't part of the
> '&' string.
>
> You'll need to check the BBEdit manual on this, starting not he bottom of
> page 187 of the 11.6 manual.
>
> "Positional Assertions
>
> Positional assertions “anchor” a pattern, without actually matching any
> characters."
>
> (?
> For example.
>
> --
> Apple broke AppleScripting signatures in Mail.app, so no random signatures.
>
>

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
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 post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: grep help coordinates

2018-03-05 Thread Fletcher Sandbeck
Something like this should do it. The unescaped parentheses define groups which 
are referred to by \1 and \2 in the replacement pattern. The escaped 
parentheses match the actual parentheses around the coordinates.

Find: \(([0-9.-]+), ([0-9.-]+)\)
Replace: \2,\1

Hope this helps,

[fletcher]


> On Mar 5, 2018, at 1:49 PM, Steve Wilson  wrote:
> 
> Need help trying to figure out how to do a grep search and replace in BBEdit 
> of a couple of coordinates into KML. 
> Unfortunately the order of the lat/long needs to be flipped.
> Here is what it looks like:
> 
> (32.839098817184, -97.303764761793)
> 
> And I need it to look like this:
> 
> -97.303764761793,32.839098817184,0.0
> 
> Thanks for any help
> 
> -- 
> This is the BBEdit Talk public discussion group. If you have a 
> feature request or would like to report a problem, please email
> "supp...@barebones.com" rather than posting to the group.
> 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 post to this group, send email to bbedit@googlegroups.com.
> Visit this group at https://groups.google.com/group/bbedit.

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
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 post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: grep help coordinates

2018-03-05 Thread Steve Wilson
Thanks!

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
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 post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: grep help coordinates

2018-03-05 Thread Marek Stepanek
On 05.03.18 22:49, Steve Wilson wrote:
> Need help trying to figure out how to do a grep search and replace in BBEdit 
> of a couple of coordinates into KML. 
> Unfortunately the order of the lat/long needs to be flipped.
> Here is what it looks like:
> 
> (32.839098817184, -97.303764761793)
> 
> And I need it to look like this:
> 
> -97.303764761793,32.839098817184,0.0
> 
> Thanks for any help
> 


Hello Steve!


I don't know, whether there are some more characters around your data.

If the coordinates are pure one per line, this should work with grep:

search:
^(-?\d\d\.\d{12}),\s*(-?\d\d\.\d{12})\s*$

replace:
\02,\01,0.0


best greetings


marek


-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
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 post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Grep help for musicxml

2022-12-05 Thread 'Marcel Lamers' via BBEdit Talk
It gets much simpler if I add e.g. a ! before every  first.
I can then search for
()([^!]+)()([^!]+)()

On Monday, 5 December 2022 at 17:13:42 UTC+1 Marcel Lamers wrote:

> Hi,
>
> I have a musicxml file that is not properly imported into my music 
> notation app and I have to change the syntax to do a better import.
> I gave it a go with grep but can't seem to get the proper pattern to make 
> the change.
>
> In short, I want to remove the dynamics tags plus content from a note tag 
> and place it before the note tag with new closing tags.
> Difficulty is the occurrence of several  tags and the greediness of 
> the patterns I tested.
> I also gave the must not occur (?!) a go but to no avail. Any 
> help in the matter would be greatly appreciated
>
> Here is an example:
>
> before
>
> 
> 
> 
> 48
> 
> 
> 
> D
> 6
> 
> 48
> 1
> quarter
> 1
> 
> 
> 
> G
> 5
> 
> 48
> 1
> quarter
> 1
> 
> 
> 
> D
> 5
> 
> 48
> 1
> quarter
> 1
> 
> 
> 
> 
> 
> 
> 
> 
> G
> 5
> 
> 48
> 1
> quarter
> 1
> 
> 
>
>
> **
> 
> 
> 
> 
>
> after
>
> 
> 
> 
> 48
> 
> 
> 
> D
> 6
> 
> 48
> 1
> quarter
> 1
> 
> 
> 
> G
> 5
> 
> 48
> 1
> quarter
> 1
> 
> 
> 
> D
> 5
> 
> 48
> 1
> quarter
> 1
> 
> 
> 
> 
> 
> 
>
>
>
>
>
>
>
>
> **
> 
> 
> G
> 5
> 
> 48
> 1
> quarter
> 1
> 
> 
> 
> 
> 
> 
>

-- 
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/10227a12-e144-4d6b-b6ff-05d6140ed85cn%40googlegroups.com.


Re: Grep help for musicxml

2022-12-05 Thread jj
Hi Marcel,

You could try this.

Find:

   
 (?s)())+)()\n((?:.(?!)

Replace:

\n\n\2\n\n\n\1\3

HTH

Jean Jourdain
On Monday, December 5, 2022 at 8:27:49 PM UTC+1 Marcel Lamers wrote:

> It gets much simpler if I add e.g. a ! before every  first.
> I can then search for
> ()([^!]+)()([^!]+)()
>
> On Monday, 5 December 2022 at 17:13:42 UTC+1 Marcel Lamers wrote:
>
>> Hi,
>>
>> I have a musicxml file that is not properly imported into my music 
>> notation app and I have to change the syntax to do a better import.
>> I gave it a go with grep but can't seem to get the proper pattern to make 
>> the change.
>>
>> In short, I want to remove the dynamics tags plus content from a note tag 
>> and place it before the note tag with new closing tags.
>> Difficulty is the occurrence of several  tags and the greediness of 
>> the patterns I tested.
>> I also gave the must not occur (?!) a go but to no avail. 
>> Any help in the matter would be greatly appreciated
>>
>> Here is an example:
>>
>> before
>>
>> 
>> 
>> 
>> 48
>> 
>> 
>> 
>> D
>> 6
>> 
>> 48
>> 1
>> quarter
>> 1
>> 
>> 
>> 
>> G
>> 5
>> 
>> 48
>> 1
>> quarter
>> 1
>> 
>> 
>> 
>> D
>> 5
>> 
>> 48
>> 1
>> quarter
>> 1
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> G
>> 5
>> 
>> 48
>> 1
>> quarter
>> 1
>> 
>> 
>>
>>
>> **
>> 
>> 
>> 
>> 
>>
>> after
>>
>> 
>> 
>> 
>> 48
>> 
>> 
>> 
>> D
>> 6
>> 
>> 48
>> 1
>> quarter
>> 1
>> 
>> 
>> 
>> G
>> 5
>> 
>> 48
>> 1
>> quarter
>> 1
>> 
>> 
>> 
>> D
>> 5
>> 
>> 48
>> 1
>> quarter
>> 1
>> 
>> 
>> 
>> 
>> 
>> 
>>
>>
>>
>>
>>
>>
>>
>>
>> **
>> 
>> 
>> G
>> 5
>> 
>> 48
>> 1
>> quarter
>> 1
>> 
>> 
>> 
>> 
>> 
>> 
>>
>

-- 
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/12abf2b1-9373-4b60-8647-36ac016b1c65n%40googlegroups.com.


Re: Grep help for musicxml

2022-12-06 Thread 'Marcel Lamers' via BBEdit Talk
Thx JJ, that works great!

On Monday, 5 December 2022 at 21:45:30 UTC+1 jj wrote:

> Hi Marcel,
>
> You could try this.
>
> Find:
>
>
>  
> (?s)())+)()\n((?:.(?!)
>
> Replace:
>
> 
> \n\n\2\n\n\n\1\3
>
> HTH
>
> Jean Jourdain
> On Monday, December 5, 2022 at 8:27:49 PM UTC+1 Marcel Lamers wrote:
>
>> It gets much simpler if I add e.g. a ! before every  first.
>> I can then search for
>> ()([^!]+)()([^!]+)()
>>
>> On Monday, 5 December 2022 at 17:13:42 UTC+1 Marcel Lamers wrote:
>>
>>> Hi,
>>>
>>> I have a musicxml file that is not properly imported into my music 
>>> notation app and I have to change the syntax to do a better import.
>>> I gave it a go with grep but can't seem to get the proper pattern to 
>>> make the change.
>>>
>>> In short, I want to remove the dynamics tags plus content from a note 
>>> tag and place it before the note tag with new closing tags.
>>> Difficulty is the occurrence of several  tags and the greediness 
>>> of the patterns I tested.
>>> I also gave the must not occur (?!) a go but to no avail. 
>>> Any help in the matter would be greatly appreciated
>>>
>>> Here is an example:
>>>
>>> before
>>>
>>> 
>>> 
>>> 
>>> 48
>>> 
>>> 
>>> 
>>> D
>>> 6
>>> 
>>> 48
>>> 1
>>> quarter
>>> 1
>>> 
>>> 
>>> 
>>> G
>>> 5
>>> 
>>> 48
>>> 1
>>> quarter
>>> 1
>>> 
>>> 
>>> 
>>> D
>>> 5
>>> 
>>> 48
>>> 1
>>> quarter
>>> 1
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> G
>>> 5
>>> 
>>> 48
>>> 1
>>> quarter
>>> 1
>>> 
>>> 
>>>
>>>
>>> **
>>> 
>>> 
>>> 
>>> 
>>>
>>> after
>>>
>>> 
>>> 
>>> 
>>> 48
>>> 
>>> 
>>> 
>>> D
>>> 6
>>> 
>>> 48
>>> 1
>>> quarter
>>> 1
>>> 
>>> 
>>> 
>>> G
>>> 5
>>> 
>>> 48
>>> 1
>>> quarter
>>> 1
>>> 
>>> 
>>> 
>>> D
>>> 5
>>> 
>>> 48
>>> 1
>>> quarter
>>> 1
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> **
>>> 
>>> 
>>> G
>>> 5
>>> 
>>> 48
>>> 1
>>> quarter
>>> 1
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>>
>>

-- 
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/125a0d7f-cda4-478d-b617-b1697d9f70e1n%40googlegroups.com.


Re: Grep help with tide table formatting

2011-11-09 Thread Alex Satrapa
On 10/11/2011, at 09:23 , John Gold wrote:

> 1 4:09 AM 17.6H
> 1 10:30 AM2.3 L
> 1 4:34 PM 16.8H
> 1 10:52 PM2.3 L
> 2 5:02 AM 17.3H
> 2 11:24 AM2.5 L
> 2 5:30 PM 16.3H
> 2 11:45 PM2.7 L
> 3 5:56 AM 17.3H
> 3 12:20 PM2.5 L
> 3 6:26 PM 16.2H

My first attempt:

Find: ^(\d+)(.*)\r\1
Replace with: \1\2\t\1

This will require a couple of passes since it matches the lines by pairs.

Hope this helps!
Alex



smime.p7s
Description: S/MIME cryptographic signature


Re: Grep help with tide table formatting

2011-11-10 Thread John Gold
Hey -- thank you very much. I'll give that a try!

John


On Nov 10, 1:33 am, Alex Satrapa  wrote:
> On 10/11/2011, at 09:23 , John Gold wrote:
>
> > 1  4:09 AM 17.6    H
> > 1  10:30 AM        2.3     L
> > 1  4:34 PM 16.8    H
> > 1  10:52 PM        2.3     L
> > 2  5:02 AM 17.3    H
> > 2  11:24 AM        2.5     L
> > 2  5:30 PM 16.3    H
> > 2  11:45 PM        2.7     L
> > 3  5:56 AM 17.3    H
> > 3  12:20 PM        2.5     L
> > 3  6:26 PM 16.2    H
>
> My first attempt:
>
> Find:         ^(\d+)(.*)\r\1
> Replace with: \1\2\t\1
>
> This will require a couple of passes since it matches the lines by pairs.
>
> Hope this helps!
> Alex
>
>  smime.p7s
> 2KViewDownload

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: Grep help with tide table formatting

2011-11-10 Thread Rod Buchanan
On Nov 9, 2011, at 4:23 PM, John Gold wrote:

> I am trying to reformat tide tables from NOAA. The data comes in this
> format:
> 
> 1 4:09 AM 17.6H
> 1 10:30 AM2.3 L
> 1 4:34 PM 16.8H
> 1 10:52 PM2.3 L
> 2 5:02 AM 17.3H
> 2 11:24 AM2.5 L
> 2 5:30 PM 16.3H
> 2 11:45 PM2.7 L
> 3 5:56 AM 17.3H
> 3 12:20 PM2.5 L
> 3 6:26 PM 16.2H
> 
> Each field is separated by a tab, each line has a return. I want to
> group all the lines that begin with a common number (1, 2, 3, etc.)
> into a single line, like this:
> 
> 1 4:09 AM 17.6H  110:30 AM2.3 L  14:34 PM 16.8
> H  110:52 PM2.3 L
> 2 5:02 AM 17.3H  211:24 AM2.5 L  25:30 PM 16.3
> H  211:45 PM2.7 L
> 3 5:56 AM 17.3H  312:20 PM2.5 L  36:26 PM 16.2
> H

I think this will work, but will require multiple passes thru the data:

Search:  ^((\d+)\t.+?)\r(\2\t.+?)$

Replace:  \1\t\3

-- 
Rod Buchanan
KDSI / Kelly Supply Co / ISCO
308 382-8764 x220

Change is inevitable, except from a vending machine.

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: Grep help with tide table formatting

2011-11-10 Thread John Gold
I'll give this one a try as well. Thanks!

On Nov 10, 10:04 am, Rod Buchanan  wrote:
> On Nov 9, 2011, at 4:23 PM, John Gold wrote:
>
>
>
>
>
>
>
>
>
> > I am trying to reformat tide tables from NOAA. The data comes in this
> > format:
>
> > 1  4:09 AM 17.6    H
> > 1  10:30 AM        2.3     L
> > 1  4:34 PM 16.8    H
> > 1  10:52 PM        2.3     L
> > 2  5:02 AM 17.3    H
> > 2  11:24 AM        2.5     L
> > 2  5:30 PM 16.3    H
> > 2  11:45 PM        2.7     L
> > 3  5:56 AM 17.3    H
> > 3  12:20 PM        2.5     L
> > 3  6:26 PM 16.2    H
>
> > Each field is separated by a tab, each line has a return. I want to
> > group all the lines that begin with a common number (1, 2, 3, etc.)
> > into a single line, like this:
>
> > 1  4:09 AM 17.6    H  1    10:30 AM        2.3     L  1    4:34 PM 16.8    
> > H  1    10:52 PM        2.3     L
> > 2  5:02 AM 17.3    H  2    11:24 AM        2.5     L  2    5:30 PM 16.3    
> > H  2    11:45 PM        2.7     L
> > 3  5:56 AM 17.3    H  3    12:20 PM        2.5     L  3    6:26 PM 16.2    H
>
> I think this will work, but will require multiple passes thru the data:
>
>         Search:  ^((\d+)\t.+?)\r(\2\t.+?)$
>
>         Replace:  \1\t\3
>
> --
> Rod Buchanan
> KDSI / Kelly Supply Co / ISCO
> 308 382-8764 x220
>
> Change is inevitable, except from a vending machine.

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: Grep help with tide table formatting

2011-11-10 Thread John Gold
Question -- Now that you've laid it out, I understand what the
expression does, except for the \1 at the end of the search pattern.
What does that do?

Thanks again!

John


On Nov 10, 9:22 am, John Gold  wrote:
> Hey -- thank you very much. I'll give that a try!
>
> John
>
> On Nov 10, 1:33 am, Alex Satrapa  wrote:
>
>
>
>
>
>
>
> > On 10/11/2011, at 09:23 , John Gold wrote:
>
> > > 1  4:09 AM 17.6    H
> > > 1  10:30 AM        2.3     L
> > > 1  4:34 PM 16.8    H
> > > 1  10:52 PM        2.3     L
> > > 2  5:02 AM 17.3    H
> > > 2  11:24 AM        2.5     L
> > > 2  5:30 PM 16.3    H
> > > 2  11:45 PM        2.7     L
> > > 3  5:56 AM 17.3    H
> > > 3  12:20 PM        2.5     L
> > > 3  6:26 PM 16.2    H
>
> > My first attempt:
>
> > Find:         ^(\d+)(.*)\r\1
> > Replace with: \1\2\t\1
>
> > This will require a couple of passes since it matches the lines by pairs.
>
> > Hope this helps!
> > Alex
>
> >  smime.p7s
> > 2KViewDownload

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: Grep help with tide table formatting

2011-11-10 Thread Alex Satrapa
On 11/11/2011, at 04:10 , John Gold wrote:

> Question -- Now that you've laid it out, I understand what the
> expression does, except for the \1 at the end of the search pattern.
> What does that do?

You're asking about deepest darkest tech magic. I could tell you, but then I'd 
have to shoot you :)

But seriously …

The short answer is that "^(\d+)(.*)\r\1" contains two matching sets: (\d+) and 
(.*). In regexes you can refer to matched sets using \1 through \9. So after 
the regex has matched everything but the \1, the engine now has two value it's 
looking for. In this case \1 is the number before the tab (matched using \d+ 
meaning "one or more digits").

The long answer is: pick up "Mastering Regular Expressions" from O'Reilly 
Press. It's a must-have reference. Find it here:
 
http://shop.oreilly.com/product/9780596528126.do?green=20956246-2551-5FD2-AF0B-2D7849E2B360&cmp=af-mybuy-9780596528126.IP

Regards
Alex

PS: strictly speaking, I wouldn't need to shoot you since you'll either end up 
being a deepest darkest tech wizard yourself, or your head will spontaneously 
explode from trying to grok regexes.

smime.p7s
Description: S/MIME cryptographic signature


Re: Grep help with tide table formatting

2011-11-15 Thread Johan™Strandberg
Only a lunatic would attack tide-tables with a regex. :-)

--j
On Nov 10, 2011 1:24 PM, "Alex Satrapa"  wrote:

> On 11/11/2011, at 04:10 , John Gold wrote:
>
> > Question -- Now that you've laid it out, I understand what the
> > expression does, except for the \1 at the end of the search pattern.
> > What does that do?
>
> You're asking about deepest darkest tech magic. I could tell you, but then
> I'd have to shoot you :)
>
> But seriously …
>
> The short answer is that "^(\d+)(.*)\r\1" contains two matching sets:
> (\d+) and (.*). In regexes you can refer to matched sets using \1 through
> \9. So after the regex has matched everything but the \1, the engine now
> has two value it's looking for. In this case \1 is the number before the
> tab (matched using \d+ meaning "one or more digits").
>
> The long answer is: pick up "Mastering Regular Expressions" from O'Reilly
> Press. It's a must-have reference. Find it here:
>
> http://shop.oreilly.com/product/9780596528126.do?green=20956246-2551-5FD2-AF0B-2D7849E2B360&cmp=af-mybuy-9780596528126.IP
>
> Regards
> Alex
>
> PS: strictly speaking, I wouldn't need to shoot you since you'll either
> end up being a deepest darkest tech wizard yourself, or your head will
> spontaneously explode from trying to grok regexes.

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: Grep help with tide table formatting

2011-11-15 Thread Doug McNutt
At 13:14 -0800 11/15/11, Johanヾtrandberg wrote:
>Only a lunatic would attack tide-tables with a regex. :-)

I dabble in geology of the only natural moon of planet Earth.  In that mode I 
am called an astrogeophysicist. and I tell folks that's to avoid calling me a 
lunatic.  I wonder how many on this list properly connected tides with Luna?  
Well done.
-- 

   Fe++
//  \
Fe++  Fe++
  |   ||
Fe++  Fe++
   \\/
   Fe++

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: Grep help with tide table formatting

2011-11-15 Thread Johan™Strandberg
>
>  I wonder how many on this list properly connected tides with Luna?  Well
> done.
>
> Well, now, the Sun has some effect too.


--j

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: Grep help - removing text within a tag

2022-10-10 Thread Kaveh
Can you put the output you expect for this string?

On Mon, 10 Oct 2022 at 22:25, a k  wrote:

> Hey all,
>
> I'm looking to use grep to remove text contained within a tag (including
> the tag itself). More specifically - I need to find and remove a bunch of
> iframe tags from multiple .txt files.
>
> Here's an example tag:
>
> * src="https://website.com/1.0/ifr?zid=123456&cb=${CACHEBUSTER}&abc_imp=${AUC_ID}&c=${CLICK_URL_ENC}&;
> "
> frameborder="0" scrolling="no" width="123" height="456">*
>
> because the zid, width and height always differ and appear in other places
> in the document (that need to be preserved) I cant do a regular find and
> replace.
>
>  a complete beginner to BBEDIT and grep so apologies if this question is a
> bit remedial. I have bunch of code cleanup tasks that are very repetitive
> and I'm confident could be solved with grep, just not 100% sure how to go
> about it.
>
> --
> 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: <
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/bbedit/ba2bdebc-1e4e-4849-ad21-bfea60bd00e4n%40googlegroups.com
> 
> .
>


-- 
Kaveh Bazargan PhD
Director
River Valley Technologies  ● Twitter
 ● LinkedIn
 ● ORCID

*Accelerating the Communication of Research*

-- 
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/CAJ2R9pi%2Bv9R%2B%3DgULdOLuYyQAvYykYj0RRdPcOX44hEG6mRvdEg%40mail.gmail.com.


Re: Grep help - removing text within a tag

2022-10-10 Thread Fletcher Sandbeck
The find pattern would be "" with "Grep" checked. You can 
use the Multi-File Search... dialog to run this against a folder containing 
your .txt files to see how many matches there are.

When I'm doing multi-file work like this I'll usually start out doing a Find 
All in the multi-file dialog and looking at all the results. If it looks like I 
want to do a replace all then I can go back into the dialog and do that. The 
replace pattern would be blank if you want to remove the iframe tags.

If I need to be more discerning I'll work through each file by file in the 
results using Find Next to make sure that I want to replace all the iframes. Or 
refine the find pattern to be more specific.

[fletcher]


> On Oct 10, 2022, at 2:22 PM, a k  wrote:
> 
> Hey all, 
> 
> I'm looking to use grep to remove text contained within a tag (including the 
> tag itself). More specifically - I need to find and remove a bunch of iframe 
> tags from multiple .txt files. 
> 
> Here's an example tag:
> 
>  src="https://website.com/1.0/ifr?zid=123456&cb=${CACHEBUSTER}&abc_imp=${AUC_ID}&c=${CLICK_URL_ENC}&";
>  frameborder="0" scrolling="no" width="123" height="456">
> 
> because the zid, width and height always differ and appear in other places in 
> the document (that need to be preserved) I cant do a regular find and replace.
> 
>  a complete beginner to BBEDIT and grep so apologies if this question is a 
> bit remedial. I have bunch of code cleanup tasks that are very repetitive and 
> I'm confident could be solved with grep, just not 100% sure how to go about 
> it.
> 
> -- 
> 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/ba2bdebc-1e4e-4849-ad21-bfea60bd00e4n%40googlegroups.com
>  
> .

-- 
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/0FF11031-E720-46E2-9E11-9B27B1BB20D7%40cumuli.com.


Re: Grep help - removing text within a tag

2022-10-10 Thread a k
Sorry for being unclear - I want to remove the text so output would be blank

On Monday, October 10, 2022 at 4:45:42 PM UTC-5 Kaveh wrote:

> Can you put the output you expect for this string?
>
> On Mon, 10 Oct 2022 at 22:25, a k  wrote:
>
>> Hey all, 
>>
>> I'm looking to use grep to remove text contained within a tag (including 
>> the tag itself). More specifically - I need to find and remove a bunch of 
>> iframe tags from multiple .txt files. 
>>
>> Here's an example tag:
>>
>> *> src="https://website.com/1.0/ifr?zid=123456&cb=${CACHEBUSTER}&abc_imp=${AUC_ID}&c=${CLICK_URL_ENC}&;
>>  
>> "
>>  
>> frameborder="0" scrolling="no" width="123" height="456">*
>>
>> because the zid, width and height always differ and appear in other 
>> places in the document (that need to be preserved) I cant do a regular find 
>> and replace.
>>
>>  a complete beginner to BBEDIT and grep so apologies if this question is 
>> a bit remedial. I have bunch of code cleanup tasks that are very repetitive 
>> and I'm confident could be solved with grep, just not 100% sure how to go 
>> about it.
>>
>> -- 
>> 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/ba2bdebc-1e4e-4849-ad21-bfea60bd00e4n%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> Kaveh Bazargan PhD
> Director
> River Valley Technologies  ● Twitter 
>  ● LinkedIn 
>  ● ORCID 
> 
> *Accelerating the Communication of Research*
>

-- 
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/e27b4656-7359-4f97-8eec-0ae3d985f110n%40googlegroups.com.


Re: Grep help - removing text within a tag

2022-10-10 Thread a k
Thanks so much! This did the trick. I've been familiarizing myself with 
multi-file search and am very excited to now have such a powerful tool to 
use for these repetitive tasks. Hoping to learn more about grep as well as 
Text Factory

On Monday, October 10, 2022 at 4:46:33 PM UTC-5 fletc...@cumuli.com wrote:

> The find pattern would be "" with "Grep" checked. You 
> can use the Multi-File Search... dialog to run this against a folder 
> containing your .txt files to see how many matches there are.
>
> When I'm doing multi-file work like this I'll usually start out doing a 
> Find All in the multi-file dialog and looking at all the results. If it 
> looks like I want to do a replace all then I can go back into the dialog 
> and do that. The replace pattern would be blank if you want to remove the 
> iframe tags.
>
> If I need to be more discerning I'll work through each file by file in the 
> results using Find Next to make sure that I want to replace all the 
> iframes. Or refine the find pattern to be more specific.
>
> [fletcher]
>
>
> On Oct 10, 2022, at 2:22 PM, a k  wrote:
>
> Hey all, 
>
> I'm looking to use grep to remove text contained within a tag (including 
> the tag itself). More specifically - I need to find and remove a bunch of 
> iframe tags from multiple .txt files. 
>
> Here's an example tag:
>
> * src="https://website.com/1.0/ifr?zid=123456&cb=${CACHEBUSTER}&abc_imp=${AUC_ID}&c=${CLICK_URL_ENC}&;
>  
> "
>  
> frameborder="0" scrolling="no" width="123" height="456">*
>
> because the zid, width and height always differ and appear in other places 
> in the document (that need to be preserved) I cant do a regular find and 
> replace.
>
>  a complete beginner to BBEDIT and grep so apologies if this question is a 
> bit remedial. I have bunch of code cleanup tasks that are very repetitive 
> and I'm confident could be solved with grep, just not 100% sure how to go 
> about it.
>
> -- 
> 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/ba2bdebc-1e4e-4849-ad21-bfea60bd00e4n%40googlegroups.com
>  
> 
> .
>
>

-- 
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/14bb00e7-7ea5-4a3a-8a89-4255ccfa927bn%40googlegroups.com.


Re: grep help (possibly requires a text factory)

2009-02-05 Thread Patrick James

On 5 Feb 2009, at 20:48, Lorin Rivers wrote:

>
> I have some data that looks like this:
>
> # visitors
> # 2009-02-04
> Item,Value,Value Percent,URL,Mumble URL
> "",498,,"",""
>
> # 2009-02-03
> Item,Value,Value Percent,URL,Mumble URL
> "",351,,"",""
>
>
> #visitors is the first line of the document
> the other bits continue in sequence
>
> I want it to look like this:
> "visitors","2009-02-04","498"
> "visitors","2009-02-03","351"

I think that for this you might like to try:

Find: # (\d\d\d\d-\d\d-\d\d)\rItem,Value,Value Percent,URL,Mumble URL 
\r"",(\d\d\d),,"",""
Replace: "visitors","\01","\02"

There's a chance the find expression has had a line break inserted by  
the email system.

It is a simple operation. The line breaks in the example are changed  
to \r. The relevant bits are captured by the parenthesis and put into  
the replace expression.

> for bonus points, this data is grouped and after the visitors section,
> there's a section starting with:
> # pages
> followed by repeating structures like this (an integer is really a
> number like 123 and a float is similar 12.3 or the like):
> # 2009-02-04
> Item,Value,Value Percent,URL,Mumble URL
> "a string",an integer,a float,"a url",""
>
> transformed to
> "pages","2009-02-04","a string","a url","an integer","a float"

This is a bit unclear. I think we lost something in the email system.

The solution is very similar to the first example. I think that you  
could put it together yourself.

To identify a digit in the find expression use \d which means  
character class [0-9].

To capture in find expression use parenthesis.

To put those into the replace expression use \01 \02 etc numbering  
from left to right.

All you need to do is create a find expression that matches it all.  
Then capture what you require and reassemble in the replace expression.

BBEdit help has the Grep Reference which is very useful.

No text factories will be required.

Patrick

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "supp...@barebones.com" 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: grep help needed for spaces in mailto links

2011-08-15 Thread oliver
Finding all "mailto:"; URIs is pretty easy:

(?<=href=")mailto:.+?(?="?>)

You could then pass the results to something like Ruby's URL encode. But 
I'll let someone else more qualified help you with that.

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: grep help needed for spaces in mailto links

2011-08-15 Thread RobS
Ignore me. I recalled that that site had only ever used two different 
subjects in the mailto links. So I used plain old multi-file search and 
replace on them. Job done.

When brains fail, use brute force.

Rob

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: grep help, delete everything other than what I'm matching

2009-10-28 Thread Doug McNutt

At 09:30 -0700 10/28/09, BB Design wrote:
>I'm using BB Edit grep to select  links like this:
>
>(\)
>
>So I can paste the match using: \1
>
>However, I basically want to delete everything else in the document
>except these links, so that all I am left with is the links. Possible
>to modify my code to accomplish this? Thanks!

First: you better make sure that regular expression isn't greedy. It's likely 
to select everything from the first  in the line or possibly 
to the end of the file.

(\)

and next you'll need to allow for links that pass through lineend characters 
unless you know a lot about the structure of the html file.

In my favorite language it would be an s after the trailing quote of the 
overall expression, //is. In BBEdit it's (\s) or something like that 
at the end of the expression.

-- 
--> So do we celebrate the start of a new decade at the end of this year? Or do 
the tens start at in January 2011? Was the first year,  ACE, assigned Roman 
numeral I ?<--

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
-~--~~~~--~~--~--~---



Re: grep help, delete everything other than what I'm matching

2009-10-28 Thread Miraz Jordan

On Thu, Oct 29, 2009 at 05:30, BB Design  wrote:
> I'm using BB Edit grep to select  links like this:
>
> (\)
>
> So I can paste the match using: \1
>
> However, I basically want to delete everything else in the document
> except these links, so that all I am left with is the links. Possible
> to modify my code to accomplish this? Thanks!
>

I'd use an Applescript to do this:

remove all Return characters -- gets everything on one line
replace  with /a>\r -- puts a Return after a link
Process lines containing " using "/a>\\r" options {search mode:grep, 
starting at
top:true, wrap around:false, backwards:false, case sensitive:false,
match words:false, extend selection:false}

-- put out lines with links
process lines containing matching string "http://knowit.co.nz/bookstore
Dogs. Fun. Outdoors. : http://runspotrun.info
iPod, iPhone, Mac Tips: http://mactips.info

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
-~--~~~~--~~--~--~---



Re: grep help, delete everything other than what I'm matching

2009-10-28 Thread BB Design

Thanks so much!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
-~--~~~~--~~--~--~---



Re: grep help, delete everything other than what I'm matching

2009-10-28 Thread Lewis Butler

On Oct 28, 2009, at 10:33, BB Design  wrote:

> However, I basically want to delete everything else in the document
> except these links, so that all I am left with is the links.

Text menu, process lines containing.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
-~--~~~~--~~--~--~---



Re: GREP help: dig into the report of the cash register

2018-12-04 Thread David G Wagner
You state what you need is in red, but you do not show any date in red. Please 
clarify...

thank you...

Wags ;)
WagsWorld
Hebrews 4:15
Ph(primary) : 408-914-1341
Ph(secondary): 408-761-7391
On Dec 4, 2018, 05:14 -0800, m.osti , wrote:
> Hello, every day when I have to close up my shop I get this report from the 
> cash register. I have the obligation to transmit some sales data through a 
> web page, and I have to insert one receipt at a time, sigh.
> Only sales that have the "C.F." are valid.
> In this case I need it in the order:
> the date
> the receipt number
> the total euro
> the alphanumeric part after C.F. for example ABCDEF12G34H567I which is of 16 
> characters always in this order 6 alphabetic characters, 2 numbers, 1 
> character, 2 numbers, 1 character, 3 numbers, 1 character.
>
> Now I copy them by hand and then I use a macro that I created in 
> KeyboardMaestro. Since there is a lot of data that I don't need, to speed up 
> I tried to extract only the necessary values through a GREP search, but I 
> failed, failed, failed and after many attempts I decided to ask.
> If it were possible I would also like the date separator to be / instead of -
>
> I'm going to put on the cash register closure below: the values I need are in 
> red.
> Thank you and sorry for my english.
> ciao from italy
>
> -m
>
> ---
>
> t_fiscale 20170422 0846 1
>                   EURO
> LENTI OFT         110,00
> MONTAGGIO LENTI    20,00
> TOTALE EURO       130,00
> CONTANTE          130,00
> C.F.   ABCDEF12G34H567I
>
> CASSA:                01
> 22-04-2017         08:46
> N.SCONTR.FISCALE       1
> t_fiscale 20170422 0936 2
>                   EURO
> LENTI CONTATTO    100,00
> TOTALE EURO       100,00
> CONTANTE          100,00
> C.F.   ABCDEF12G34H567I
>
> CASSA:                01
> 22-04-2017         09:36
> N.SCONTR.FISCALE       2
> t_fiscale 20170422 1037 3
>                   EURO
> MONTATURE OFT     120,00
> LENTI OFT         120,00
> MONTAGGIO LENTI    20,00
> TOTALE EURO       260,00
> CONTANTE          260,00
> C.F.   LMNOPQ89R01S234T
>
> CASSA:                01
> 22-04-2017         10:37
> N.SCONTR.FISCALE       3
> t_fiscale 20170422 1055 4
>                   EURO
> IVA 22              8,00
> TOTALE EURO         8,00
> CONTANTE            8,00
>
> CASSA:                01
> 22-04-2017         10:55
> N.SCONTR.FISCALE       4
> t_fiscale 20170422 1826 5
>                   EURO
> SOLUZIONI LAC      23,00
> TOTALE EURO        23,00
> CONTANTE           23,00
> C.F.   LMNOPQ89R01S234T
>
> CASSA:                01
> 22-04-2017         18:26
> N.SCONTR.FISCALE       5
> t_non fiscale 20170422 1843 1
>       NON FISCALE
>     RAPPORTO REPARTI "Z"
>          PERIODICO 1
> (++ BELOW UNNECESSARY DATA ++)
> DATA ULTIMO AZZERAMENTO
>                    21-04-2017
>
> CASSA:                01
> 22-04-2017         18:43
> N.SCONTR.NON FISC      1
>       NON FISCALE
> t_fiscale 20170422 1843 6
>       RAPPORTO *Z*
>     CHIUSURA FISCALE
>       DATI IN EURO
>
> 
>      CORRISPETTIVI
>        SCONTRINI
> 
> CORRISP. GIORNALIERI
>                 1 234,00
> PROGR. CORRISPETTIVI
>               123 456,78
> NOTE DI CREDITO GIORN.
>                     0,00
>
> 
>      CORRISPETTIVI
>     DOCUMENTI CL.II
> 
> CORRISP. GIORNALIERI
>                     0,00
> *FATTURE            0,00
> *RICEVUTE           0,00
> NOTE DI CREDITO GIORN.
>                     0,00
>
> 
>        DETTAGLIO
>        OPERAZIONI
> 
> SCONTI              0,00
>       N.    0
> MAGGIORAZ.          0,00
>       N.    0
> BONIFICI            0,00
>       N.    0
> RETTIFICHE          0,00
>       N.    0
> CORRISP. NON RISCOSSI
> *SCONTRINI          0,00
> *RICEVUTE           0,00
> CORRISP. RISCOSSI
> *SCONTRINI      1 234,00
> *FATTURE            0,00
> *RICEVUTE           0,00
>
> 
>        DOCUMENTI
>       GIORNALIERI
> 
> N.SCONTR.FISCALI       6
> *N.SCONTR./NOTE CRED.  0
> N.SCONTR.N FISCALI     1
> *N.RAPP.LETTURE DGFE   0
>
> N.DOCUMENTI CL.II      0
> *N.FATTURE             0
> *N.FATTURE/NOTE CRED.  0
> *N.RICEVUTE            0
>
> 
>      DATI GENERALI
> 
> N.LETT.MEM.FISCALE     0
>
> PROGR. AZZERAMENTI   960
> NUM. RIPRISTINI        0
>
> 
> DISPOS.GIORN.ELETTRONICO
>       N.2 DEL 02-05-2014
>        MATR. 05 30005163
>
> CASSA:                01
> 22-04-2017         18:43
> N.SCONTR.FISCALE       6
>
> --
> 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 to the group.
> Follow @bbedit on Twitter: 
> ---
> You received this message because you are subscribed to the Google Groups 
> "BBEdit Talk" group.
> To unsubscribe from this 

Re: GREP help: dig into the report of the cash register

2018-12-04 Thread Christopher Stone
On 12/04/2018, at 04:19, m.osti mailto:mk0...@gmail.com>> 
wrote:
> Hello, every day when I have to close up my shop I get this report from the 
> cash register. I have the obligation to transmit some sales data through a 
> web page, and I have to insert one receipt at a time, sigh.
> Only sales that have the "C.F." are valid.


Hey M.,

This is a bit of a sticky problem, so I'm not surprised you had problems when 
relying on grep alone.

Run this AppleScript from the Applescript Editor against your register tape in 
BBEdit.

I believe I've extracted the relevant data from the tape.  If so then we need 
another pass to get just the values you want.

>From there it shouldn't be hard to pop those values into Keyboard Maestro 
>variables for insertion into your web page.

--
Best Regards,
Chris


# Auth: Christopher Stone
# dCre: 2018/12/04 16:04
# dMod: 2018/12/04 16:04 
# Appl: BBEdit
# Task: Extract Cash Register Info.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @BBEdit, @Extract, @Cash, @Register, @Info, 
@BBEdit-Talk


set AppleScript's text item delimiters to ""

tell application "BBEdit"
tell front text window's text

replace "^\\h+EURO\\h*\\n" using "" options {search mode:grep, case 
sensitive:false, starting at top:true}
replace "^\\h+$" using "" options {search mode:grep, case 
sensitive:false, starting at top:true}
replace "\\n{2,}" using "\\n" options {search mode:grep, case 
sensitive:false, starting at top:true}
replace "^N\\.SCONTR\\.FISCALE.*" using "&\\n" options {search 
mode:grep, case sensitive:false, starting at top:true}
replace "\\A\\s+|\\s+\\Z" using "" options {search mode:grep, case 
sensitive:false, starting at top:true}

set docText to its text
set AppleScript's text item delimiters to linefeed & linefeed
set recordList to text items of docText

repeat with i in recordList
if contents of i does not contain "C.F." then
set contents of i to missing value
end if
end repeat

set recordList to (text of recordList) as text
set its text to recordList

replace "^(?>(?:(?!(?:t_fiscale|C\\.F\\.|\\d{2}-\\d{2}-\\d{4}|TOTALE 
EURO)).)*)$\\R?" using "" options {search mode:grep, case sensitive:false, 
starting at top:true}
replace "^t_fiscale" using "\\n&" options {search mode:grep, case 
sensitive:false, starting at top:true}
replace "\\A\\s+|\\s+\\Z" using "" options {search mode:grep, case 
sensitive:false, starting at top:true}

select insertion point before it

end tell
end tell



-- 
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 to the group.
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 post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: GREP help: dig into the report of the cash register

2018-12-05 Thread m.osti


Il giorno martedì 4 dicembre 2018 21:41:43 UTC+1, David Wagner ha scritto:
>
> You state what you need is in red, but you do not show any date in red. 
> Please clarify...
>

Sorry Wags, it's cause I'm on google groups via web browser, and it allows 
HTML view.
Below the picture.
ty
-m

[image: Schermata 2018-12-05 alle 09.23.59.png]
 

-- 
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 to the group.
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 post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: GREP help: dig into the report of the cash register

2018-12-05 Thread m.osti


Il giorno martedì 4 dicembre 2018 23:12:49 UTC+1, Christopher Stone ha 
scritto:
>
> On 12/04/2018, at 04:19, m.osti > wrote:
>
> Hello, every day when I have to close up my shop I get this report from 
> the cash register. I have the obligation to transmit some sales data 
> through a web page, and I have to insert one receipt at a time, sigh.
> Only sales that have the "C.F." are valid.
>
> --
>
> Hey M.,
>
> This is a bit of a sticky problem, so I'm not surprised you had problems 
> when relying on grep alone.
>
> Run this AppleScript from the Applescript Editor against your register 
> tape in BBEdit.
>
> I believe I've extracted the relevant data from the tape.
>

Thank you Chris, this just _works_ !!!
You scripters save my life from time to time :)
-m

-- 
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 to the group.
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 post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: GREP help: dig into the report of the cash register

2018-12-05 Thread @lbutlr
On Tue Dec 04 2018 03:19:02 m.osti   said:
> 
> Now I copy them by hand and then I use a macro that I created in 
> KeyboardMaestro. Since there is a lot of data that I don't need, to speed up 
> I tried to extract only the necessary values through a GREP search, but I 
> failed, failed, failed and after many attempts I decided to ask.
> If it were possible I would also like the date separator to be / instead of -

The grep for the date is pretty straightforward, since you can match on 
# and I assume that the date is going to be the same on all the 
transactions. So grab the date and deal with the amount and CF separately.

It should be possible to setup a grep that looks for

fiscal[stuff](date)(number)[end of line][anystuff] EURO (numbers a comma 
numbers)[end of line][anystuff]C.F.[spaces](alphanumerics)[space][endofline]

\1 contains your date, and you can format it however you want ()(..)(..) 
gives you  mm dd
\2 contains your (transaction) number
\3 the Euro amount
\4 the C.F. ID

If you have a scanner that supports OCR (including an iOS app), scanning the 
receipts and putting them somewhere on your computer means that Hazel would be 
able to process the recipes automatically. Add an AppleScript and you can 
probably automate the submission to your web portal.

(It would take me a long time to build the actual grep, but basically the idea 
is there and some playing with it will yield something that works)

-- 
'He's mad, isn't he?' 'No, mad's when you froth at the mouth,' said
Gaspode. ' He's insane. That's when you froth at the brain.’





-- 
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 to the group.
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 post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


  1   2   >