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.