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 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-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.


Grep help for musicxml

2022-12-05 Thread 'Marcel Lamers' via BBEdit Talk
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/eab39f71-c0d2-460a-a76a-ae716a0a5eb5n%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 - 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 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 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.


Grep help - removing text within a tag

2022-10-10 Thread a k
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:

*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.


Re: Need a little GREP help

2022-10-04 Thread Kaveh
Hi Michael

Glad it worked. It's actually very easy once you get the knack. I have been
meaning to do some video tutorials so thanks for the prompt. Feel free to
remind me again. No problem if you want to email privately.

Regards
Kaveh

On Tue, 4 Oct 2022 at 13:51, Michael Heth  wrote:

>
>
> > On Oct 4, 2022, at 5:37 AM, Kaveh 
> wrote:
> >
> > Search:
> > (.+)
> > Replace:
> > \1
>
> Thanks much, worked like a champ.
>
> I’ll have to try and wade through the docs on GREP again and see if it
> catches this time.
>
> Or, Or,
>
> The folks at BB could do a 5 minute YT video showing various examples of
> common tasks and then billions of BBEdit users would all get a leg up.
>
> Just sayin’
>
> Thanks again.
>
> 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 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/745945A7-23A3-4BDA-B9E6-F197A46BA5E9%40gmail.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/CAJ2R9ph0Rp9dfV5ZgHctVaf74fXNSUoRtwvfMa_zo4zC00k8Bw%40mail.gmail.com.


Re: Need a little GREP help

2022-10-04 Thread Michael Heth



> On Oct 4, 2022, at 5:37 AM, Kaveh  wrote:
> 
> Search:
> (.+)
> Replace:
> \1

Thanks much, worked like a champ.

I’ll have to try and wade through the docs on GREP again and see if it catches 
this time.

Or, Or, 

The folks at BB could do a 5 minute YT video showing various examples of common 
tasks and then billions of BBEdit users would all get a leg up.

Just sayin’

Thanks again.

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 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/745945A7-23A3-4BDA-B9E6-F197A46BA5E9%40gmail.com.


Re: Need a little GREP help

2022-10-04 Thread eu...@gmx.de
Search Pattern:  ^.*$

Replace Pattern: \0

Will do the job!



> Am 04.10.2022 um 06:18 schrieb Michael Heth :
> 
> Say Folks,
> 
> Have been trying to get my head around GREP for many years and never quite 
> get it.
> 
> I've asked for help before and folks were able to give me the cryptic code to 
> get my little task in the done column.
> 
> So, I have a list with over 450 lines like these
> 
> 1995 DUCATI M600 Monster
> 1995 DUCATI M900 Monster
> 1995 DUCATI Superbike 748 Biposto / SP
> 1995 DUCATI Superbike 916 Biposto / Senna
> 
> and I need them to end up like this
> 
> 1995 DUCATI M600 Monster
> 1995 DUCATI M900 Monster
> 1995 DUCATI Superbike 
> 748 Biposto / SP
> 1995 DUCATI 
> Superbike 916 Biposto / Senna
> 
> Any tips.help is much appreciated.
> 
> Thanks,
> 
> 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 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/2d19291b-ac2f-41f4-9517-ee5cad8d2505n%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/1D04EF61-BE8A-4356-A509-479BC8F8591C%40gmx.de.


Re: Need a little GREP help

2022-10-04 Thread Kaveh
Search:
(.+)
Replace:
\1

On Tue, 4 Oct 2022 at 13:28, Michael Heth  wrote:

> Say Folks,
>
> Have been trying to get my head around GREP for many years and never quite
> get it.
>
> I've asked for help before and folks were able to give me the cryptic code
> to get my little task in the done column.
>
> So, I have a list with over 450 lines like these
>
> 1995 DUCATI M600 Monster
> 1995 DUCATI M900 Monster
> 1995 DUCATI Superbike 748 Biposto / SP
> 1995 DUCATI Superbike 916 Biposto / Senna
>
> and I need them to end up like this
>
> 1995 DUCATI M600 Monster
> 1995 DUCATI M900 Monster
> 1995 DUCATI
> Superbike 748 Biposto / SP
> 1995 DUCATI
> Superbike 916 Biposto / Senna
>
> Any tips.help is much appreciated.
>
> Thanks,
>
> 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 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/2d19291b-ac2f-41f4-9517-ee5cad8d2505n%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/CAJ2R9pj_yr%2BK4pjFQnZvCvUb33FEp%3DfKq38cZJKOyheOjswLHQ%40mail.gmail.com.


Need a little GREP help

2022-10-04 Thread Michael Heth
Say Folks,

Have been trying to get my head around GREP for many years and never quite 
get it.

I've asked for help before and folks were able to give me the cryptic code 
to get my little task in the done column.

So, I have a list with over 450 lines like these

1995 DUCATI M600 Monster
1995 DUCATI M900 Monster
1995 DUCATI Superbike 748 Biposto / SP
1995 DUCATI Superbike 916 Biposto / Senna

and I need them to end up like this

1995 DUCATI M600 Monster
1995 DUCATI M900 Monster
1995 DUCATI 
Superbike 748 Biposto / SP
1995 DUCATI 
Superbike 916 Biposto / Senna

Any tips.help is much appreciated.

Thanks,

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 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/2d19291b-ac2f-41f4-9517-ee5cad8d2505n%40googlegroups.com.


Re: Need Grep help to get first digit (or letter) in each row

2022-01-17 Thread Howard
Thanks Tom and Christopher.
Howard

On Sunday, 16 January 2022 at 8:38:24 pm UTC-5 Christopher Waterman wrote:

> Hello Howard,
>
> Find: ^[^0-9A-Z]?([0-9A-Z]).*
>
> Replace: \1
>
>
>
> — Chris(topher)?
>
>

-- 
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/2331a3f2-4ec1-466a-9545-ee40976e6604n%40googlegroups.com.


Re: Need Grep help to get first digit (or letter) in each row

2022-01-16 Thread Tom Robinson
^[^a-z0-9]*(.).*$

^ at beginning of line
[^a-z0-9] look for anything which isn’t a-z 0-9
* 0 or more times
(.) any single character (i.e. a-z 0-9), and ‘capture’ it for replacement 
pattern
★ any characters
$ end of line

Replace with

\1

Cheers


> On 2022-01-17, at 12:16, Howard  wrote:
> 
> Using the input data below and using Grep, I need either the first digit  or 
> letter extracted from each row (just one per row), so the output looks like 
> what is shown below. Though the output is displayed here in horizontal 
> format, I need the actual output in vertical format without any commas.
> Howard
> 
> Output
> 9, 3, D, 6, 8, 5, 3, 9, 5, 2, 7, 4, 3, D, 8, 7
> 
> Input data:
> *9/HD
> *3D/5
> *D1/H97
> *69/8HD
> *87/HD
> 57983/H
> *3
> *97D/8H
> *5D/H
> *2/D3H
> *7H/8
> *4/H
> *3/D5
> *D7/9
> *84/H
> 7DH/9
> 
> -- 
> 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/5bc28303-df27-47a4-a6ca-a0e0d20e6a43n%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/8A1B4EFE-21E9-48C4-91B8-07660F48BBE8%40gmail.com.


Need Grep help to get first digit (or letter) in each row

2022-01-16 Thread Howard
Using the *input data* below and using Grep, I need either the first digit 
 or letter extracted from each row (just one per row), so the *output* looks 
like what is shown below. Though the output is displayed here in horizontal 
format, I need the actual output in vertical format without any commas.
Howard

*Output*
9, 3, D, 6, 8, 5, 3, 9, 5, 2, 7, 4, 3, D, 8, 7

*Input data:*
*9/HD
*3D/5
*D1/H97
*69/8HD
*87/HD
57983/H
*3
*97D/8H
*5D/H
*2/D3H
*7H/8
*4/H
*3/D5
*D7/9
*84/H
7DH/9

-- 
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/5bc28303-df27-47a4-a6ca-a0e0d20e6a43n%40googlegroups.com.


Re: A little grep help

2019-02-13 Thread @lbutlr
On 13 Feb 2019, at 00:43, Christopher Stone  wrote:
> That has to be a typo on your friend's part.  There's no sense in adding a 
> capture for an optional literal 'm' – it adds nothing and can mangle words 
> ending in 'm'.

Yep, none of the input I was testing had words ending in m, evidently. This, of 
course, only added to my confusion as to what this was doing and why it worked!


-- 
Well boys, we got three engines out, we got more holes in us than a
horse trader's mule, the radio is gone and we're leaking fuel and if we
was flying any lower why we'd need sleigh bells on this thing... but we
got one little budge on those Roosskies. At this height why they might
harpoon us but they dang sure ain't gonna spot us on no radar screen!




-- 
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: A little grep help

2019-02-12 Thread Christopher Stone
On 02/12/2019, at 06:38, @lbutlr mailto:krem...@kreme.com>> 
wrote:
> I asked someone how to remove all spaces in an string more efficiently and he 
> responded with
> 
> search: (m?)\s+
> replace: (nul)
> 
> which sure does work.
> 
> But WHY?


On 02/12/2019, at 16:26, @lbutlr mailto:krem...@kreme.com>> 
wrote:
> On 12 Feb 2019, at 06:53, Rich Siegel  > wrote:
>> 'm guessing it was "(?m)\s+"
> 
> That would make SLIGHTLY more sense, but it is definitely (m?)\s+ (I’ve 
> checked it a dozen times)



Hey Lewis,

That has to be a typo on your friend's part.  There's no sense in adding a 
capture for an optional literal 'm' – it adds nothing and can mangle words 
ending in 'm'.

This is test
 Maximum Text
With some spaces

ThisistestMaximuTextWithsomespaces

I've no idea why the person in question might feel the need to turn ON 
multiline.  (I'd guess habit.)

Corrected:

search: (?m)\s+

Turning OFF multiline works just the same:

search: (?-m)\s+

#!/usr/bin/env perl -sw
while (<>) {
s!\s+!!g;
print;
}

All produce your compressed string:

ThisistestTextWithsomespaces

> What I don’t get is that in the sample
> 
> < This is test
>  Text
> With some spaces
> END
> 
> The result is
> 
> ThisistestTextWithsomespaces
> 
> Which is to say that it removes all the white space. All at once. In one 
> action.


Were you were wanting to remove horizontal whitespace only?

Find: \h+
Repl: null

Vertical whitespace can be isolated with “\v”.

--
Best Regards,
Chris

-- 
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: A little grep help

2019-02-12 Thread ThePorgie
Seems like an odd search string. The (m?) would be to capture a patten for 
an optional m before your space. If you're just wanting to get the spaces I 
don't know why you would include this when the \s would get them all with a 
replacement of null and selecting the replace all option. Including the 
pattern (m?) would also get the m's if followed by a space unless you 
returned the pattern in the replace field by using \1 (\1 is assuming only 
one pattern match in your search string being for the m) 

Of note. The \s also gets returns so you will get one long string if using 
the replace all option. You could try \h+ and have more luck. (\h will 
leave the returns).



On Tuesday, February 12, 2019 at 7:38:17 AM UTC-5, @lbutlr wrote:
>
> I asked someone how to remove all spaces in an string more efficiently and 
> he responded with 
>
> search: (m?)\s+ 
> replace: (nul) 
>
> which sure does work. 
>
> But WHY? 
>
> That is, I know what this does, but I don't understand the syntax 
>
>
> -- 
> Major Strasser has been shot. Round up the usual suspects. 
>
>

-- 
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: A little grep help

2019-02-12 Thread Sam Hathaway

It's NOT doing the same thing is (?m). Apply your pattern to this sample:

Yum yum I munch this text.

I get:

YuyuImunchthistext.

On February 12, 2019 5:38:05 PM "@lbutlr"  wrote:


On 12 Feb 2019, at 15:29, Sam Hathaway  wrote:
How exactly are you applying this pattern? Is this in BBEdit’s find window? 
I can’t replicate what you’re seeing. (For me it replaces one span of 
spaces at a time, including any m that precedes it.)


Never mind, in BBEdit I am of course, doing a replace all (which is so 
ingrained I didn’t think about it at all).


As far as I can tell, this behaves identically to (?m)\s+ (which I 
understand, I think) and since BBEdit defaults (?m) to on, it is not 
needed, \s+ replace all with (nun) does the same thing.


➕

--
And what rough beast, its hour come round at last,
Slouches towards Bethlehem to be born?

--
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.




--
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: A little grep help

2019-02-12 Thread @lbutlr
On 12 Feb 2019, at 15:37, @lbutlr  wrote:
> replace all with (nun) 

Thanks for the helpful autocorrect! (nul)

-- 
'What can I do? I'm only human,' he said aloud. Someone said, Not all
of you. —Pyramids

-- 
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: A little grep help

2019-02-12 Thread @lbutlr
On 12 Feb 2019, at 15:29, Sam Hathaway  wrote:
> How exactly are you applying this pattern? Is this in BBEdit’s find window? I 
> can’t replicate what you’re seeing. (For me it replaces one span of spaces at 
> a time, including any m that precedes it.)

Never mind, in BBEdit I am of course, doing a replace all (which is so 
ingrained I didn’t think about it at all).

As far as I can tell, this behaves identically to (?m)\s+ (which I understand, 
I think) and since BBEdit defaults (?m) to on, it is not needed, \s+ replace 
all with (nun) does the same thing.

➕

-- 
And what rough beast, its hour come round at last,
Slouches towards Bethlehem to be born?

-- 
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: A little grep help

2019-02-12 Thread Sam Hathaway
How exactly are you applying this pattern? Is this in BBEdit’s find 
window? I can’t replicate what you’re seeing. (For me it replaces 
one span of spaces at a time, including any `m` that precedes it.)

-sam

On 12 Feb 2019, at 17:26, @lbutlr wrote:


On 12 Feb 2019, at 06:53, Rich Siegel  wrote:

'm guessing it was "(?m)\s+"


Tha would make SLIGHTLY more sense, but it is definitely (m?)\s+ 
(I’ve checked it a dozen times)


what I don’t get is that in the sample


---
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 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: A little grep help

2019-02-12 Thread @lbutlr
On 12 Feb 2019, at 06:53, Rich Siegel  wrote:
> 'm guessing it was "(?m)\s+"

Tha would make SLIGHTLY more sense, but it is definitely (m?)\s+ (I’ve checked 
it a dozen times)

what I don’t get is that in the sample


--- 
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: A little grep help

2019-02-12 Thread Néstor E. Aguilera
Notice that \s includes line feeds/carriage returns/form feeds, so perhaps it 
is not what you want.

For just spaces and tabs you may try [^ \t]+ (user manual, p. 187).

Nestor

===

> On 12 Feb 2019, at 10:42, Sam Hathaway  wrote:
> 
> This would seem to remove any m character that is followed by one or more 
> spaces, so I don’t think it quite does what you asked for. Not sure why it 
> would be faster either.
> -sam
> 
> On 12 Feb 2019, at 7:38, @lbutlr wrote:
> 
> I asked someone how to remove all spaces in an string more efficiently and he 
> responded with
> 
> search: (m?)\s+
> replace: (nul)
> 
> which sure does work.
> 
> But WHY?
> 
> That is, I know what this does, but I don't understand the syntax
> 
> 
> -- 
> Major Strasser has been shot. Round up the usual suspects.
> 
> -- 
> 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.
> 
> 
> -- 
> 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.

-- 
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: A little grep help

2019-02-12 Thread Rich Siegel

On 2/12/19 at 7:38 AM, krem...@kreme.com (@lbutlr) wrote:


search: (m?)\s+


I'm guessing it was "(?m)\s+", and attached is a screenshot from 
the user manual.


R.
--
Rich Siegel Bare Bones Software, Inc.
  

Someday I'll look back on all this and laugh... until they 
sedate me.


--
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: A little grep help

2019-02-12 Thread Sam Hathaway
This would seem to remove any `m` character that is followed by one or 
more spaces, so I don’t think it _quite_ does what you asked for. Not 
sure why it would be faster either.

-sam

On 12 Feb 2019, at 7:38, @lbutlr wrote:

I asked someone how to remove all spaces in an string more efficiently 
and he responded with


search: (m?)\s+
replace: (nul)

which sure does work.

But WHY?

That is, I know what this does, but I don't understand the syntax


--
Major Strasser has been shot. Round up the usual suspects.

--
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.


--
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.


A little grep help

2019-02-12 Thread @lbutlr
I asked someone how to remove all spaces in an string more efficiently and he 
responded with

search: (m?)\s+
replace: (nul)

which sure does work.

But WHY?

That is, I know what this does, but I don't understand the syntax


-- 
Major Strasser has been shot. Round up the usual suspects.

-- 
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-14 Thread m.osti
Hi Chris, thank you for the support ;) 

> I can write another script that will parse these into variables that can 
be inserted into your web page.

This is over my skill Chris :( but for your information, I have to put 
other data in 3 consecutive web pages. I set up 2 macros with Keyboad 
Maestro: the 1st just copy (clic & drag to select) the 4 row: receipt 
number, date, amount, cf, and put them all into the related variables. then 
it switch to chrome and calls the second one macro. Not so elegant, nor 
fully automated, but it's fast and safe and I can check it easily. as 
always sry for my english.

Il giorno venerdì 7 dicembre 2018 11:21:49 UTC+1, Christopher Stone ha 
scritto:
>
> On 12/06/2018, at 13:44, Christopher Stone  > wrote:
>
> Here's an updated script that produces cleaner output.
> From here I would probably turn the output into tab-delimited single lines.
>
> --
>
> Hey Marco,
>
> The newest incarnation of the script (appended) produces output like this:
>
> 1 130,00 ABCDEF12G34H567I 22-04-2017
> 2 100,00 ABCDEF12G34H567I 22-04-2017
> 3 260,00 LMNOPQ89R01S234T 22-04-2017
> 5 23,00 LMNOPQ89R01S234T 22-04-2017
>
> I can write another script that will parse these into variables that can 
> be inserted into your web page.
>
> Each pass will show a line item as processed like so:
>
> [✓] 1 130,00 ABCDEF12G34H567I 22-04-2017
>
> If you set the windows of your web browser and BBEdit up just so, you can 
> get realtime visual feedback on each pass.
>
> --
> Best Regards,
> Chris
>
> 
> # Auth: Christopher Stone
> # dCre: 2018/12/04 16:04
> # dMod: 2018/12/07 02:43
> # Appl: BBEdit
> # Task: Extract Cash Register Info.
> # Libs: None
> # Osax: None
> # Tags: @Applescript, @Script, @BBEdit, @Extract, @Cash, @Register, @Info, 
> @BBEdit-Talk
> # Vers: 1.02
> 
>
> *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* "\\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*}
>
> 
> *replace* "^t_fiscale \\d{8} \\d{4} *" using "" options {search 
> mode:*grep*, case sensitive:*false*, starting at top:*true*}
> *replace* "^TOTALE EURO\\h+" using "" options {search mode:*grep*, 
> case sensitive:*false*, starting at top:*true*}
> *replace* "C\\.F\\.\\h*" using "" options {search mode:*grep*, case 
> sensitive:*false*, starting at top:*true*}
> *replace* "^(\\d{2}-\\d{2}-\\d{4})\\h+\\d{2}:\\d{2}" using "\\1" 
> options {search mode:*grep*, case sensitive:*false*, starting at top:
> *true*}
> *replace* "(?<=\\w)\\R(?=\\w)" using "\\t" options {search mode:
> *grep*, case sensitive:*false*, starting at top:*true*}
> *replace* "^$\\R" 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 ema

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

2018-12-14 Thread m.osti
Hi, I tried this also and seems to me the result is the same as the 
previous one: perfect.
I use the multi search function of bbedit: it scans all the folders 
containing the files (one per day) and in 4 seconds extracts all the data. 
awesome!

Ah, there was only a receipt with an amount of 1000,00 and the script 
extracts just "1", same for the previous script as well. I saw it 
immediately because it was without ", 00" so no problem.
Here it is:
5
02/10/2018
1
MCCGLC87A49V111R

Thank you again, you save me a lot of time, of very boring time ;)

Il giorno venerdì 7 dicembre 2018 15:37:47 UTC+1, ThePorgie ha scritto:
>
> Ok, I think I've narrowed down the greedy over-run to only look between 
> matching register numbers...So basically this should work regardless of 
> varying number of item lines in your receipt.
>
> Search:
> t_fiscale (\d{4})(\d{2})(\d{2}) (\d+) (\d+)$(?s).*?TOTALE EURO 
> +([0-9,]+).*?C\.F\. +([\w]+).*?N\.SCONTR\.FISCALE +\5
>
> Replace:
> \5\n\3/\2/\1\n\6\n\7\n\n
>
> On Friday, December 7, 2018 at 4:03:26 AM UTC-5, m.osti wrote:
>>
>> Well ThePorgie, not sure to have understood your note but... now it's 
>> perfect.
>> thank you
>>
>> Il giorno giovedì 6 dicembre 2018 19:33:55 UTC+1, ThePorgie ha scritto:
>>>
>>> Right you are. I didn't notice that when I last tested. Try this:
>>> t_fiscale (\d{4})(\d{2})(\d{2}) (\d+) (\d+)$(?:.*\n){1,8}?TOTALE EURO 
>>> +([0-9,]+)(?:.*\n){1,3}?C\.F\. +([\w]+)
>>>
>>> and replace:
>>> \5\n\3/\2/\1\n\6\n\7\n\n
>>>
>>> Note: I'm not sure how many items you can have listed on your receipt 
>>> which causes me pause even with this grep string as 1 receipt with a long 
>>> list will get skipped. I couldn't come up with a way to stop the greedy 
>>> over-run if the string didn't contain the "C.F" line. If someone else 
>>> notices something in this regard that I overlooked that would be great.
>>>
>>>
>>> On Thursday, December 6, 2018 at 12:27:43 PM UTC-5, m.osti wrote:

 thank you for your concern. this GREP search is quite good: it get also 
 the sale(s) without CF that are unnecessary but I can just ignore them at 
 a 
 fast glance.

 Il giorno mercoledì 5 dicembre 2018 18:20:28 UTC+1, ThePorgie ha 
 scritto:
>
> I see you've got a script, but I like a puzzle... seems to work like 
> this.
>
> t_fiscale (\d{4})(\d{2})(\d{2}) (\d+) (\d+)$(?s).+?TOTALE EURO 
> +([0-9,]+).+?C\.F\. +([\w,]+)
>
> I used this with the extract option
>
>
> On Tuesday, December 4, 2018 at 8:14:34 AM UTC-5, 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 LENTI20,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 CONTATTO100,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 LENTI20,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  

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

2018-12-07 Thread ThePorgie
Ok, I think I've narrowed down the greedy over-run to only look between 
matching register numbers...So basically this should work regardless of 
varying number of item lines in your receipt.

Search:
t_fiscale (\d{4})(\d{2})(\d{2}) (\d+) (\d+)$(?s).*?TOTALE EURO 
+([0-9,]+).*?C\.F\. +([\w]+).*?N\.SCONTR\.FISCALE +\5

Replace:
\5\n\3/\2/\1\n\6\n\7\n\n

On Friday, December 7, 2018 at 4:03:26 AM UTC-5, m.osti wrote:
>
> Well ThePorgie, not sure to have understood your note but... now it's 
> perfect.
> thank you
>
> Il giorno giovedì 6 dicembre 2018 19:33:55 UTC+1, ThePorgie ha scritto:
>>
>> Right you are. I didn't notice that when I last tested. Try this:
>> t_fiscale (\d{4})(\d{2})(\d{2}) (\d+) (\d+)$(?:.*\n){1,8}?TOTALE EURO 
>> +([0-9,]+)(?:.*\n){1,3}?C\.F\. +([\w]+)
>>
>> and replace:
>> \5\n\3/\2/\1\n\6\n\7\n\n
>>
>> Note: I'm not sure how many items you can have listed on your receipt 
>> which causes me pause even with this grep string as 1 receipt with a long 
>> list will get skipped. I couldn't come up with a way to stop the greedy 
>> over-run if the string didn't contain the "C.F" line. If someone else 
>> notices something in this regard that I overlooked that would be great.
>>
>>
>> On Thursday, December 6, 2018 at 12:27:43 PM UTC-5, m.osti wrote:
>>>
>>> thank you for your concern. this GREP search is quite good: it get also 
>>> the sale(s) without CF that are unnecessary but I can just ignore them at a 
>>> fast glance.
>>>
>>> Il giorno mercoledì 5 dicembre 2018 18:20:28 UTC+1, ThePorgie ha scritto:

 I see you've got a script, but I like a puzzle... seems to work like 
 this.

 t_fiscale (\d{4})(\d{2})(\d{2}) (\d+) (\d+)$(?s).+?TOTALE EURO 
 +([0-9,]+).+?C\.F\. +([\w,]+)

 I used this with the extract option


 On Tuesday, December 4, 2018 at 8:14:34 AM UTC-5, 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 LENTI20,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 CONTATTO100,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 LENTI20,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
> CONTANTE8,00
> 
> CASSA:01
> 22-04-2017 10:55
> N.SCONTR.FISCALE   4
> t_fiscale 20170422 1826 *5*
>   EURO  
> SOLUZIONI LAC  23,00
> TOTALE EURO23,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-

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

2018-12-07 Thread Christopher Stone
On 12/06/2018, at 13:44, Christopher Stone mailto:listmeis...@suddenlink.net>> wrote:
> Here's an updated script that produces cleaner output.
> From here I would probably turn the output into tab-delimited single lines.


Hey Marco,

The newest incarnation of the script (appended) produces output like this:

1   130,00  ABCDEF12G34H567I22-04-2017
2   100,00  ABCDEF12G34H567I22-04-2017
3   260,00  LMNOPQ89R01S234T22-04-2017
5   23,00   LMNOPQ89R01S234T22-04-2017

I can write another script that will parse these into variables that can be 
inserted into your web page.

Each pass will show a line item as processed like so:

[✓] 1   130,00  ABCDEF12G34H567I22-04-2017

If you set the windows of your web browser and BBEdit up just so, you can get 
realtime visual feedback on each pass.

--
Best Regards,
Chris


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


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 "\\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}

replace "^t_fiscale \\d{8} \\d{4} *" using "" options {search 
mode:grep, case sensitive:false, starting at top:true}
replace "^TOTALE EURO\\h+" using "" options {search mode:grep, case 
sensitive:false, starting at top:true}
replace "C\\.F\\.\\h*" using "" options {search mode:grep, case 
sensitive:false, starting at top:true}
replace "^(\\d{2}-\\d{2}-\\d{4})\\h+\\d{2}:\\d{2}" using "\\1" options 
{search mode:grep, case sensitive:false, starting at top:true}
replace "(?<=\\w)\\R(?=\\w)" using "\\t" options {search mode:grep, 
case sensitive:false, starting at top:true}
replace "^$\\R" 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-07 Thread m.osti
Well ThePorgie, not sure to have understood your note but... now it's 
perfect.
thank you

Il giorno giovedì 6 dicembre 2018 19:33:55 UTC+1, ThePorgie ha scritto:
>
> Right you are. I didn't notice that when I last tested. Try this:
> t_fiscale (\d{4})(\d{2})(\d{2}) (\d+) (\d+)$(?:.*\n){1,8}?TOTALE EURO 
> +([0-9,]+)(?:.*\n){1,3}?C\.F\. +([\w]+)
>
> and replace:
> \5\n\3/\2/\1\n\6\n\7\n\n
>
> Note: I'm not sure how many items you can have listed on your receipt 
> which causes me pause even with this grep string as 1 receipt with a long 
> list will get skipped. I couldn't come up with a way to stop the greedy 
> over-run if the string didn't contain the "C.F" line. If someone else 
> notices something in this regard that I overlooked that would be great.
>
>
> On Thursday, December 6, 2018 at 12:27:43 PM UTC-5, m.osti wrote:
>>
>> thank you for your concern. this GREP search is quite good: it get also 
>> the sale(s) without CF that are unnecessary but I can just ignore them at a 
>> fast glance.
>>
>> Il giorno mercoledì 5 dicembre 2018 18:20:28 UTC+1, ThePorgie ha scritto:
>>>
>>> I see you've got a script, but I like a puzzle... seems to work like 
>>> this.
>>>
>>> t_fiscale (\d{4})(\d{2})(\d{2}) (\d+) (\d+)$(?s).+?TOTALE EURO 
>>> +([0-9,]+).+?C\.F\. +([\w,]+)
>>>
>>> I used this with the extract option
>>>
>>>
>>> On Tuesday, December 4, 2018 at 8:14:34 AM UTC-5, 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 LENTI20,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 CONTATTO100,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 LENTI20,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
 CONTANTE8,00
 
 CASSA:01
 22-04-2017 10:55
 N.SCONTR.FISCALE   4
 t_fiscale 20170422 1826 *5*
   EURO  
 SOLUZIONI LAC  23,00
 TOTALE EURO23,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

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

2018-12-06 Thread Christopher Stone
On 12/06/2018, at 11:30, m.osti mailto:mk0...@gmail.com>> 
wrote:
> of course, this way the result is even cleaner and easier then to use


Hey Marco,

Here's an updated script that produces cleaner output.

>From here I would probably turn the output into tab-delimited single lines.

Because from there it's easy to write a macro to extract the data and insert it 
into your web page one line at a time.

--
Best Regards,
Chris


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


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}

replace "^t_fiscale \\d{8} \\d{4} *" using "" options {search 
mode:grep, case sensitive:false, starting at top:true}
replace "^TOTALE EURO\\h+" using "" options {search mode:grep, case 
sensitive:false, starting at top:true}
replace "C\\.F\\.\\h*" using "" options {search mode:grep, case 
sensitive:false, starting at top:true}
replace "^(\\d{2}-\\d{2}-\\d{4})\\h+\\d{2}:\\d{2}" using "\\1" 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-06 Thread ThePorgie
Right you are. I didn't notice that when I last tested. Try this:
t_fiscale (\d{4})(\d{2})(\d{2}) (\d+) (\d+)$(?:.*\n){1,8}?TOTALE EURO 
+([0-9,]+)(?:.*\n){1,3}?C\.F\. +([\w]+)

and replace:
\5\n\3/\2/\1\n\6\n\7\n\n

Note: I'm not sure how many items you can have listed on your receipt which 
causes me pause even with this grep string as 1 receipt with a long list 
will get skipped. I couldn't come up with a way to stop the greedy over-run 
if the string didn't contain the "C.F" line. If someone else notices 
something in this regard that I overlooked that would be great.


On Thursday, December 6, 2018 at 12:27:43 PM UTC-5, m.osti wrote:
>
> thank you for your concern. this GREP search is quite good: it get also 
> the sale(s) without CF that are unnecessary but I can just ignore them at a 
> fast glance.
>
> Il giorno mercoledì 5 dicembre 2018 18:20:28 UTC+1, ThePorgie ha scritto:
>>
>> I see you've got a script, but I like a puzzle... seems to work like this.
>>
>> t_fiscale (\d{4})(\d{2})(\d{2}) (\d+) (\d+)$(?s).+?TOTALE EURO 
>> +([0-9,]+).+?C\.F\. +([\w,]+)
>>
>> I used this with the extract option
>>
>>
>> On Tuesday, December 4, 2018 at 8:14:34 AM UTC-5, 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 LENTI20,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 CONTATTO100,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 LENTI20,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
>>> CONTANTE8,00
>>> 
>>> CASSA:01
>>> 22-04-2017 10:55
>>> N.SCONTR.FISCALE   4
>>> t_fiscale 20170422 1826 *5*
>>>   EURO  
>>> SOLUZIONI LAC  23,00
>>> TOTALE EURO23,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
>>> *FATTURE0,00
>>> *RICEVUTE   0,00
>>> NOTE DI CREDI

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

2018-12-06 Thread m.osti
with this option there is an error: it get sales #4 (sale without CF = 
unnecessary) but it ignore sale #5 (with CF = necessary)
of course, this way the result is even cleaner and easier then to use

Il giorno mercoledì 5 dicembre 2018 18:25:36 UTC+1, ThePorgie ha scritto:
>
>
> oops...you might need the replace info
> \5\n\1/\2/\3\n\6\n\7
>
>
> On Wednesday, December 5, 2018 at 12:20:28 PM UTC-5, ThePorgie wrote:
>>
>> I see you've got a script, but I like a puzzle... seems to work like this.
>>
>> t_fiscale (\d{4})(\d{2})(\d{2}) (\d+) (\d+)$(?s).+?TOTALE EURO 
>> +([0-9,]+).+?C\.F\. +([\w,]+)
>>
>> I used this with the extract option
>>
>
ohh yess,  that also works! kudos
thank you

-- 
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-06 Thread m.osti
thank you for your concern. this GREP search is quite good: it get also the 
sale(s) without CF that are unnecessary but I can just ignore them at a 
fast glance.

Il giorno mercoledì 5 dicembre 2018 18:20:28 UTC+1, ThePorgie ha scritto:
>
> I see you've got a script, but I like a puzzle... seems to work like this.
>
> t_fiscale (\d{4})(\d{2})(\d{2}) (\d+) (\d+)$(?s).+?TOTALE EURO 
> +([0-9,]+).+?C\.F\. +([\w,]+)
>
> I used this with the extract option
>
>
> On Tuesday, December 4, 2018 at 8:14:34 AM UTC-5, 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 LENTI20,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 CONTATTO100,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 LENTI20,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
>> CONTANTE8,00
>> 
>> CASSA:01
>> 22-04-2017 10:55
>> N.SCONTR.FISCALE   4
>> t_fiscale 20170422 1826 *5*
>>   EURO  
>> SOLUZIONI LAC  23,00
>> TOTALE EURO23,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
>> *FATTURE0,00
>> *RICEVUTE   0,00
>> NOTE DI CREDITO GIORN.  
>> 0,00
>> 
>> 
>>DETTAGLIO
>>OPERAZIONI   
>> 
>> SCONTI  0,00
>>   N.0   
>> MAGGIORAZ.  0,00
>>   N.0   
>> BONIFICI0,00
>>   N.0   
>> RETTIFICHE  0,00
>>   N.0   
>> CORRISP. NON RISCOSSI   
>> *SCONTRINI  0,00
>> *RICEVUTE   0,00
>> CORRISP. RISCOSSI   
>> *SCONTRINI  1 234,00
>> *FATTURE0,00
>> *RICEVUTE   0,00
>> 
>> 
>>DOCUMENTI
>>   GIORNALIERI   
>> 
>> N.SCONTR.FISCALI   6
>> *N.SCONTR./NOTE CRE

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

2018-12-05 Thread ThePorgie

oops...you might need the replace info
\5\n\1/\2/\3\n\6\n\7


On Wednesday, December 5, 2018 at 12:20:28 PM UTC-5, ThePorgie wrote:
>
> I see you've got a script, but I like a puzzle... seems to work like this.
>
> t_fiscale (\d{4})(\d{2})(\d{2}) (\d+) (\d+)$(?s).+?TOTALE EURO 
> +([0-9,]+).+?C\.F\. +([\w,]+)
>
> I used this with the extract option
>
>
> On Tuesday, December 4, 2018 at 8:14:34 AM UTC-5, 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 LENTI20,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 CONTATTO100,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 LENTI20,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
>> CONTANTE8,00
>> 
>> CASSA:01
>> 22-04-2017 10:55
>> N.SCONTR.FISCALE   4
>> t_fiscale 20170422 1826 *5*
>>   EURO  
>> SOLUZIONI LAC  23,00
>> TOTALE EURO23,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
>> *FATTURE0,00
>> *RICEVUTE   0,00
>> NOTE DI CREDITO GIORN.  
>> 0,00
>> 
>> 
>>DETTAGLIO
>>OPERAZIONI   
>> 
>> SCONTI  0,00
>>   N.0   
>> MAGGIORAZ.  0,00
>>   N.0   
>> BONIFICI0,00
>>   N.0   
>> RETTIFICHE  0,00
>>   N.0   
>> CORRISP. NON RISCOSSI   
>> *SCONTRINI  0,00
>> *RICEVUTE   0,00
>> CORRISP. RISCOSSI   
>> *SCONTRINI  1 234,00
>> *FATTURE0,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 

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

2018-12-05 Thread ThePorgie
I see you've got a script, but I like a puzzle... seems to work like this.

t_fiscale (\d{4})(\d{2})(\d{2}) (\d+) (\d+)$(?s).+?TOTALE EURO 
+([0-9,]+).+?C\.F\. +([\w,]+)

I used this with the extract option


On Tuesday, December 4, 2018 at 8:14:34 AM UTC-5, 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 LENTI20,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 CONTATTO100,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 LENTI20,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
> CONTANTE8,00
> 
> CASSA:01
> 22-04-2017 10:55
> N.SCONTR.FISCALE   4
> t_fiscale 20170422 1826 *5*
>   EURO  
> SOLUZIONI LAC  23,00
> TOTALE EURO23,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
> *FATTURE0,00
> *RICEVUTE   0,00
> NOTE DI CREDITO GIORN.  
> 0,00
> 
> 
>DETTAGLIO
>OPERAZIONI   
> 
> SCONTI  0,00
>   N.0   
> MAGGIORAZ.  0,00
>   N.0   
> BONIFICI0,00
>   N.0   
> RETTIFICHE  0,00
>   N.0   
> CORRISP. NON RISCOSSI   
> *SCONTRINI  0,00
> *RICEVUTE   0,00
> CORRISP. RISCOSSI   
> *SCONTRINI  1 234,00
> *FATTURE0,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.RICEVUTE0
> 
> 
>  DATI GENERALI  
> 
> N.LETT.MEM.FISCALE 0
> 
> PROGR. AZZERAMENTI   960
> NUM. RIPRISTIN

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.


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-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-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 

GREP help: dig into the report of the cash register

2018-12-04 Thread m.osti
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 LENTI20,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 CONTATTO100,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 LENTI20,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
CONTANTE8,00

CASSA:01
22-04-2017 10:55
N.SCONTR.FISCALE   4
t_fiscale 20170422 1826 *5*
  EURO  
SOLUZIONI LAC  23,00
TOTALE EURO23,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
*FATTURE0,00
*RICEVUTE   0,00
NOTE DI CREDITO GIORN.  
0,00


   DETTAGLIO
   OPERAZIONI   

SCONTI  0,00
  N.0   
MAGGIORAZ.  0,00
  N.0   
BONIFICI0,00
  N.0   
RETTIFICHE  0,00
  N.0   
CORRISP. NON RISCOSSI   
*SCONTRINI  0,00
*RICEVUTE   0,00
CORRISP. RISCOSSI   
*SCONTRINI  1 234,00
*FATTURE0,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.RICEVUTE0


 DATI GENERALI  

N.LETT.MEM.FISCALE 0

PROGR. AZZERAMENTI   960
NUM. RIPRISTINI0


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 unsubsc

Re: Another Newbie GREP help request...

2018-05-19 Thread Christopher Stone
On 05/14/2018, at 22:15, Matthew London mailto:mlon...@gmail.com>> wrote:
> PS.Grateful if someone can recommend a "GREP for non-programmers" written in 
> plain(er) English so I don't have to bother you very helpful people here.


Hey Matthew,

It takes a while to get good enough with regular expressions to manage anything 
but the basics without a hint or two, but don't let that worry you – Practice 
makes Progress.

It's been awhile, since I updated this – but all the links are current.

--
Best Regards,
Chris

---
Some Information on Learning Regular Expressions – by Christopher C. Stone
---

Learning basic regular expressions is relatively easy.  Becoming really good 
with them takes dedication, a lot of practice, and some tutelage.

The BBEdit Manual devotes a whole chapter to regular expressions: Searching 
with Grep (currently chapter 8).  It's a reference rather than a tutorial, but 
it does explain at least briefly many of the fundamentals.

My cheat-sheet for BBEdit is up on Gist:

https://gist.github.com/ccstone/5385334 


BBEdit uses PCRE (Perl Compatible Regular Expressions), so it's a pretty decent 
if not complete reference.

Regex neophytes are better off starting with a book specifically written for 
beginners.

I have these books (in addition to a couple of tomes on Perl):

"Sams Teach Yourself Regular Expressions in 10 Minutes" by Ben Forta
"Beginning Regular Expressions" by Andrew Watt
"Regular Expressions Cookbook"  by Jan Goyvaerts and Steven Levithan
"Mastering Regular Expressions" by Jeffrey Friedl (Advanced)

There's a decent little utility available on the App-Store called 'Patterns' 
that live-updates as you create your pattern. ($2.99)

https://itunes.apple.com/us/app/patterns-the-regex-app/id429449079?mt=12 


I've found it very handy to have live feedback when building a complex pattern 
and wish I'd had something like that when I started learning regex more than 20 
years ago.

Extracting a good working knowledge of regular expressions from the Internet is 
a serious chore.  There are many flavors of regex out there, such as Perl/PCRE, 
Java, Javascript, Ruby, Python, TCL...  They're all similar, but the 
differences can be very confusing and frustrating.

Nevertheless there are many useful online resources.  Here are a few:

http://www.agillo.net/regex-primer-part-1/ 

http://www.agillo.net/regex-primer-part-2/ 

http://www.codeproject.com/KB/dotnet/regextutorial.aspx 

http://www.regular-expressions.info/tutorial.html 


---
Tags: @Learning, @Regular, @Expressions, @Regular_Expressions, @RegEx, @GREP, 
@Info
---


-- 
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: Another Newbie GREP help request...

2018-05-18 Thread Matthew London
I think I see my problem.
I was using "Process Lines Containing" which appears to extract the entire 
line, not matter what I search for.
I used Search with the Extract function, and it works now! 

Thank you


On Friday, May 18, 2018 at 1:47:33 AM UTC-7, Rick Gordon wrote:
>
> Change the .* in your string to [^.]* 
>
> (And you don't need the square brackets around \. ) 
>
> So: 
> from [A-Z][a-zA-Z][^.]*\. 
>
> …which really means: 
>
>  from followed by a space 
>
>  a single capital letter, not including diacriticals/accents 
>
>  a single letter of any case, not including diacriticals/accents 
>
>  any number (including zero) of non-period characters (which may 
> include other punctuation, spaces, line breaks, etc.) 
>
>  a period 
>
> Does that work, or do you need to be more specific? 
>

-- 
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: Another Newbie GREP help request...

2018-05-18 Thread Rick Gordon

Change the .* in your string to [^.]*

(And you don't need the square brackets around \. )

So:
from [A-Z][a-zA-Z][^.]*\.

…which really means:

from followed by a space

a single capital letter, not including diacriticals/accents

a single letter of any case, not including diacriticals/accents

any number (including zero) of non-period characters (which may 
include other punctuation, spaces, line breaks, etc.)


a period

Does that work, or do you need to be more specific?

Rick Gordon


On May 18, 2018 at 1:33:08 AM [-0700],
Matthew London wrote in an email entitled
"Re: Another Newbie GREP help request...":
I managed to figure out that the following would give me everything 
that had "from" followed by a capital letter, with a period followed 
by a space at the end:


from [A-Z][a-zA-Z].*[\. ]

But that also gives me all the sentences in the line which 
preceded the one I need!


How would I strip out all the sentences that precede the one I need?

___
RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___
WWW: http://www.shelterpub.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: <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: Another Newbie GREP help request...

2018-05-17 Thread Matthew London
Thank you all for helping with such a simple request.
However, I realize now that I didn't even word my request accurately.
I understand that for BBEdit, a "line" is everything up until the next 
"line break"

What I need is to search for SENTENCES, not LINES.

I managed to figure out that the following would give me everything that 
had "from" followed by a capital letter, with a period followed by a space 
at the end:

from [A-Z][a-zA-Z].*[\. ]

But that also gives me all the sentences in the line which preceded the one 
I need!

How would I strip out all the sentences that precede the one I need?

(BTW I understand that GREP is literal, and without an even fancier search 
won't be able to distinguish between a period in "Mr. Whitney" and "Mount 
Whitney is covered in snow.", but I'm willing to live with that.)

I did look in the manual but still couldn't figure this out.

Thank you,
Matthew

On Tuesday, May 15, 2018 at 7:46:19 AM UTC-7, Patrick Woolsey wrote:
>
> Please try this: 
>
> from [A-Z][a-zA-Z]+ 
>
> with both the "Case sensitive" and "Grep" options enabled. 
> ...
> As to grep references, I suggest you start with Chapter 8 
> "Searching with Grep" of the included PDF manual (available at 
> any time via Help -> User Manual) and work from there. 
>

-- 
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: Another Newbie GREP help request...

2018-05-15 Thread Patrick Woolsey

Please try this:

from [A-Z][a-zA-Z]+

with both the "Case sensitive" and "Grep" options enabled.

In summary, "from " will match these literal characters, while 
the first _character class_ [A-Z] will match a single capital 
letter, and the second _character class_ [a-zA-Z] modified by + 
will match 'at least one or more' capital and/or lowercase letters.


(NB: You may wish to fine-tune this pattern depending on what 
you want a "word" to consist of. :-)


As to grep references, I suggest you start with Chapter 8 
"Searching with Grep" of the included PDF manual (available at 
any time via Help -> User Manual) and work from there.



Regards,

 Patrick Woolsey
==
Bare Bones Software, Inc. 




On 5/14/18 at 11:15 PM, mlon...@gmail.com (Matthew London) wrote:


Hi,
Struggling to get my head around GREP...

I need to use Process Lines Containing function in BBEdit to 
find all lines that  contain the word "from" followed by a 
space, followed by any word that begins with a capital letter


ie:   He is from California
but not
He is from his mother


PS.Grateful if someone can recommend a "GREP for 
non-programmers" written in plain(er) English so I dont have to 
bother you very helpful people here.

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: Another Newbie GREP help request...

2018-05-15 Thread Kerri Hicks
A slight modification to Holger's answer above --

from [A-Z]

works. Be sure to tick the "Case sensitive" box at the top of the dialog.

[image: Screen Shot 2018-05-15 at 8.52.20 AM.png]

--Kerri
​

On Tue, May 15, 2018 at 8:33 AM 'Holger Bartel' via BBEdit Talk <
bbedit@googlegroups.com> wrote:

> Hi,
>
> if I’m not mistaken you could use either
>
> from [A-Z]+
>
> Or
>
> from [[:upper:]]+
>
> Not on a computer right now, so this is untested, but hopefully is correct
> and helps ;)
>
> As for books, maybe one of the O’Reilly pocket references, but I’m not
> sure about the plainer english…
>
> Best,
> Holger
>
>
> On 15 May 2018, at 5:15 AM, Matthew London  wrote:
>
> Hi,
> Struggling to get my head around GREP...
>
> I need to use Process Lines Containing function in BBEdit to find all
> lines that  contain the word "from" followed by a space, followed by any
> word that begins with a capital letter
>
> ie:
> He is from California
> but not
> He is from his mother
>
>
> PS.Grateful if someone can recommend a "GREP for non-programmers" written
> in plain(er) English so I dont have to bother you very helpful people here.
> 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.
>
> --
> 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: Another Newbie GREP help request...

2018-05-15 Thread 'Holger Bartel' via BBEdit Talk
Hi, 

if I’m not mistaken you could use either

from [A-Z]+

Or 

from [[:upper:]]+

Not on a computer right now, so this is untested, but hopefully is correct and 
helps ;) 

As for books, maybe one of the O’Reilly pocket references, but I’m not sure 
about the plainer english…

Best,
Holger


> On 15 May 2018, at 5:15 AM, Matthew London  wrote:
> 
> Hi,
> Struggling to get my head around GREP...
> 
> I need to use Process Lines Containing function in BBEdit to find all lines 
> that  contain the word "from" followed by a space, followed by any word that 
> begins with a capital letter
> 
> ie:   
> He is from California
> but not
> He is from his mother
> 
> 
> PS.Grateful if someone can recommend a "GREP for non-programmers" written in 
> plain(er) English so I dont have to bother you very helpful people here.
> 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.

-- 
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.


Another Newbie GREP help request...

2018-05-15 Thread Matthew London
Hi,
Struggling to get my head around GREP...

I need to use Process Lines Containing function in BBEdit to find all lines 
that  contain the word "from" followed by a space, followed by any word 
that begins with a capital letter

ie:   
He is from California
but not
He is from his mother


PS.Grateful if someone can recommend a "GREP for non-programmers" written 
in plain(er) English so I dont have to bother you very helpful people here.
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 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 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.


grep help coordinates

2018-03-05 Thread Steve Wilson
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.


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

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-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-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.


Grep help

2017-10-06 Thread Lee Hinde
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: BBEdit Find and replace using grep help

2017-03-28 Thread Nikao
Thank you!

On Tuesday, March 28, 2017 at 3:49:58 PM UTC-5, Tom Robinson wrote:
>
> That’s an easy one :] 
>
> Search for this: 
>
> ^.+$ 
>
> ^  says look for '’ at beginning of line 
> .  look for any character 
> +  …one or more times 
> $  says look for '’ at end of line 
>
> Cheers 
>
>
> > On 2017-03-29, at 08:55, Nikao > wrote: 
> > 
> > I am very new to Grep and was wondering if some one could help with 
> this. 
> > 
> > I want to replace the whole line of code that starts with: 
> > 
> >  
> > 
> > and ends with 
> > 
> >  
> > 
> > In the middle the content will not be the same in every document. That 
> is why I want to be able to find a line that starts and ends like that and 
> replace the whole line of code. 
> > 
> > Example entries: 
> > 
> >  
> >  
> >  
> >  
> >  
>
>

-- 
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: BBEdit Find and replace using grep help

2017-03-28 Thread Tom Robinson
That’s an easy one :]

Search for this:

^.+$

^  says look for '’ at beginning of line
.  look for any character
+  …one or more times
$  says look for '’ at end of line

Cheers


> On 2017-03-29, at 08:55, Nikao  wrote:
> 
> I am very new to Grep and was wondering if some one could help with this.
> 
> I want to replace the whole line of code that starts with:
> 
> 
> 
> and ends with
> 
> 
> 
> In the middle the content will not be the same in every document. That is why 
> I want to be able to find a line that starts and ends like that and replace 
> the whole line of code.
> 
> Example entries:
> 
> 
> 
> 
> 
> 

-- 
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.


BBEdit Find and replace using grep help

2017-03-28 Thread Nikao
I am very new to Grep and was wondering if some one could help with this.

I want to replace the whole line of code that starts with:



and ends with



In the middle the content will not be the same in every document. That is 
why I want to be able to find a line that starts and ends like that and 
replace the whole line of code.

Example entries:







-- 
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

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

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.


Grep help

2014-05-13 Thread jgill
Probably a very basic question but it has me stumped.

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?

TIA

-- 
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-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 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 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-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-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.


Grep help

2014-02-17 Thread Ted Burger
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.

Thanks,
Ted
***  Ted Burger  
t...@tobsupport.com  * www.tobsupport.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?

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?

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-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 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-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-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.




Grep help?

2013-02-20 Thread Lorin Rivers
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

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

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
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-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-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 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 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 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-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: 





grep help

2012-08-05 Thread Steven
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-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-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
<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>


GREP help

2012-04-16 Thread David
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"

Once I find all the occurrences of all the No Fly List entries, I am
going to remove them, but I know I can do that with a multi-file
search and replace, and replace the found string of varying number of
employee numbers with a single carriage return.

-- 
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-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-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 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 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
><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>


  1   2   >