Counting

2019-04-22 Thread Francisco Hirsch
I have this type of list (tab separated) (I show only two columns)
.
Municipio: 25 de Mayo
LemaSublema Letra   
Frente Popular Agrario y Social Conviccion y Lucha Letra E  
Frente Popular Agrario y Social Unión y Compromiso Letra G  
Frente Renovador de la ConcordiaCompromiso con el Futuro Letra A
Frente Renovador de la ConcordiaCon la Fe y la Esperanza Letra C
Frente Renovador de la ConcordiaEl Momento Es Ahora Letra B 
Juntos por el CambioVamos Juntos Letra F
Juntos por el CambioVientos de Cambio Letra D   

.
Municipio: Alba Posse
LemaSublema_Letra
Frente Popular Agrario y Social Para Crecer con Justicia y Trabajo Letra E  
Frente Renovador de la ConcordiaCon la Fuerza de Todos Letra B  
Frente Renovador de la ConcordiaJuntos Podemos Letra A  
Frente Renovador de la ConcordiaOrden y Trabajo Letra C 
Juntos por el CambioAvancemos Juntos Letra D

.

I have made a text factory that converts it to HTML tables, and it works (I’m 
showing the barest essentials).


Municipio: 25 de Mayo

LemaSublema Letra
Frente Popular Agrario y SocialConviccion y Lucha Letra 
E
Frente Popular Agrario y SocialUnión y Compromiso Letra 
G
Frente Renovador de la ConcordiaCompromiso con el Futuro Letra 
A
Frente Renovador de la ConcordiaCon la Fe y la Esperanza Letra 
C
Frente Renovador de la ConcordiaEl Momento Es Ahora Letra 
B
Juntos por el CambioVamos Juntos Letra F
Juntos por el CambioVientos de Cambio Letra D



Municipio: Alba Posse

LemaSublema Letra
Frente Popular Agrario y SocialPara Crecer con Justicia y 
Trabajo Letra E
Frente Renovador de la ConcordiaCon la Fuerza de Todos Letra 
B
Frente Renovador de la ConcordiaJuntos Podemos Letra 
A
Frente Renovador de la ConcordiaOrden y Trabajo Letra 
C
Juntos por el CambioAvancemos Juntos Letra D





But: The first column has cells that repeat themselves.
So I would need someway of counting the repetitions and replace them with 
rowspan=“n”  to get this:


Municipio: 25 de Mayo

LemaSublema Letra
Frente Popular Agrario y SocialConviccion y Lucha 
Letra E
Unión y Compromiso Letra G
Frente Renovador de la ConcordiaCompromiso con el 
Futuro Letra A
Con la Fe y la Esperanza Letra C
El Momento Es Ahora Letra B
Juntos por el CambioVamos Juntos Letra F
Vientos de Cambio Letra D



Municipio: Alba Posse

LemaSublema Letra
Frente Popular Agrario y SocialPara Crecer con Justicia y 
Trabajo Letra E
Frente Renovador de la ConcordiaCon la Fuerza de 
Todos Letra B
Juntos Podemos Letra A
Orden y Trabajo Letra C
Juntos por el CambioAvancemos Juntos Letra D





How can I do this?
Thanks in advance!

Francisco
--
Lic. Francisco A. Hirsch
https://www.fiscaldemesa.com.ar 
Twitter: https://twitter.com/fiscaldemesa







-- 
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: How to get truncated output from RegEx search

2019-04-22 Thread ThePorgie
If I'm understanding try
Find:
((?s).+?)
Replace:
\1



On Monday, April 22, 2019 at 4:10:31 AM UTC-4, Gustave Stresen-Reuter wrote:
>
> Thanks to everyone. 
>
> I had forgotten about bbfind but the solution I ended up using was what 
> Rich had suggested: Extract (and then a bit more processing on the net 
> result). Also, I had to fiddle a bit with the RegEx as it was being too 
> greedy. I'm still struggling to attain expertise with non-capturing parens 
> and positional assertions. Specifically, given:
>
>  Fusce rhoncus, elit.
> [Aenean] eget es?
>Nulla et arcu.
> 
>
> I'd like to find "Nulla" where the text before and after can be anything 
> except  (in other words, the contents of an element).
>
> Years ago (20?) I saw an article that suggested breaking the text up into 
> (repeatable) fields using RegEx. At the time this seemed so advanced it was 
> more than my little brain could process, but the idea has stuck with me and 
> I now wonder if it would be a better approach than what I'm trying to do.
>
> Thanks!
>
>
> On Fri, Apr 19, 2019 at 9:02 PM Christopher Stone  > wrote:
>
>> On 04/19/2019, at 07:53, Gustave Stresen-Reuter > > wrote:
>>
>> The problem here, though, is that the search results are sent to a search 
>> results window. Is there any way to recreate the behavior of the grep 
>> command above (the output is just the matching data with no filename, line 
>> number, nor context)?
>>
>> --
>>
>> Hey Ted,
>>
>> Try using the `bbfind` command line tool instead of `grep`.
>>
>> --
>> Best Regards,
>> Chris
>>
>> -- 
>> This is the BBEdit Talk public discussion group. If you have a 
>> feature request or need technical support, please email
>> "sup...@barebones.com " rather than posting to the group.
>> Follow @bbedit on Twitter: 
>> --- 
>> 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 bbe...@googlegroups.com .
>> To post to this group, send email to bbe...@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: Any way to DESELECT/UNSELECT selected text ?

2019-04-22 Thread F. Alfredo Rego
Thanks Rich.

I’ll immediately correct/improve my first (second?) AppleScript ever ;-)

As a favorite professor used to say: You have to know everything before you can 
do anything.

I appreciate the guidance.

Alfredo

> On Apr 22, 2019, at 7:23 AM, Rich Siegel  wrote:
> 
> On 4/21/19 at 11:11 AM, f.alfredor...@gmail.com (F. Alfredo Rego) wrote:
> 
>> I have explored everywhere I can, but I can’t find any way to
>> DESELECT/UNSELECT selected text.
> 
> There is no concept of "unselecting", because there is always a selection, 
> even if it's empty (an insertion point).
> 
>> I’m particularly interested in including a “deselect all” in a script
>> like this, which leaves the entire contents of the “Prototype” file
>> selected and highlighted after I have copied the “Prototype” file to
>> the “Release” file.
> 
> You can avoid the whole issue by not using the clipboard. :-) (In general, 
> you shouldn't use the clipboard to pass data around within a script.)
> 
> There are a couple of things that will help you write faster and more 
> reliable scripts:
> 
> - the "open" verb always returns a reference to the document that was opened;
> 
> - the contents of any text document are available as text. This is the "text" 
> property.
> 
> So, your first tell block will look something like this:
> 
>set openedDocument to (open file "...")
>set documentText to text of openedDocument
> 
> Then you can manipulate "documentText", and finally:
> 
>set documentToRewrite to (open file "...")
>set text of documentToRewrite to documentText
> 
> 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.

-- 
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: Any way to DESELECT/UNSELECT selected text ?

2019-04-22 Thread Rich Siegel
On 4/21/19 at 11:11 AM, f.alfredor...@gmail.com (F. Alfredo 
Rego) wrote:



I have explored everywhere I can, but I can’t find any way to
DESELECT/UNSELECT selected text.


There is no concept of "unselecting", because there is always a 
selection, even if it's empty (an insertion point).



I’m particularly interested in including a “deselect all” in a script
like this, which leaves the entire contents of the “Prototype” file
selected and highlighted after I have copied the “Prototype” file to
the “Release” file.


You can avoid the whole issue by not using the clipboard. :-) 
(In general, you shouldn't use the clipboard to pass data around 
within a script.)


There are a couple of things that will help you write faster and 
more reliable scripts:


- the "open" verb always returns a reference to the document 
that was opened;


- the contents of any text document are available as text. This 
is the "text" property.


So, your first tell block will look something like this:

set openedDocument to (open file "...")
set documentText to text of openedDocument

Then you can manipulate "documentText", and finally:

set documentToRewrite to (open file "...")
set text of documentToRewrite to documentText

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.


Any way to DESELECT/UNSELECT selected text ?

2019-04-22 Thread F. Alfredo Rego
Hello everyone,

I’m using AppleScript + BBEdit to “refresh” all the files in the “Release” 
directory with the contents of all the files in the “Prototype” directory. I do 
this “transfer of the file contents” (instead of simply copying and 
over-writing the files), to preserve the entire git history of each “Release” 
file.

I have explored everywhere I can, but I can’t find any way to DESELECT/UNSELECT 
selected text.

I’m particularly interested in including a “deselect all” in a script like 
this, which leaves the entire contents of the “Prototype” file selected and 
highlighted after I have copied the “Prototype” file to the “Release” file.

Of course, I’ll also appreciate any comments regarding a BETTER way to do this.

Thank you,

Alfredo



tell application "BBEdit"
activate
open {file “Alfredo 
HD:Users:alfredo:Documents:Prototype:Adager_API:adager_api.c”} with LF 
translation
select text 1 of project window 1
copy selection
end tell

# . . . Other stuff (irrelevant for this topic) . . .

tell application "BBEdit"
activate
open {file "Alfredo 
HD:Users:alfredo:Documents:Release:Adager_API:adager_api.c"} with LF translation
select text 1 of project window 1
paste
close project window 1 saving yes
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: How to get truncated output from RegEx search

2019-04-22 Thread Gustave Stresen-Reuter
Thanks to everyone.

I had forgotten about bbfind but the solution I ended up using was what
Rich had suggested: Extract (and then a bit more processing on the net
result). Also, I had to fiddle a bit with the RegEx as it was being too
greedy. I'm still struggling to attain expertise with non-capturing parens
and positional assertions. Specifically, given:

 Fusce rhoncus, elit.
[Aenean] eget es?
   Nulla et arcu.


I'd like to find "Nulla" where the text before and after can be anything
except  (in other words, the contents of an element).

Years ago (20?) I saw an article that suggested breaking the text up into
(repeatable) fields using RegEx. At the time this seemed so advanced it was
more than my little brain could process, but the idea has stuck with me and
I now wonder if it would be a better approach than what I'm trying to do.

Thanks!


On Fri, Apr 19, 2019 at 9:02 PM Christopher Stone <
listmeis...@suddenlink.net> wrote:

> On 04/19/2019, at 07:53, Gustave Stresen-Reuter 
> wrote:
>
> The problem here, though, is that the search results are sent to a search
> results window. Is there any way to recreate the behavior of the grep
> command above (the output is just the matching data with no filename, line
> number, nor context)?
>
> --
>
> Hey Ted,
>
> Try using the `bbfind` command line tool instead of `grep`.
>
> --
> 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.
>

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