Re: How to get truncated output from RegEx search

2019-04-19 Thread Christopher Stone
On 04/19/2019, at 07:53, Gustave Stresen-Reuter mailto:tedmaster...@gmail.com>> 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.


Re: "tags" file for Text Completion

2019-04-19 Thread Scott in Pollock
On Friday, April 19, 2019 at 8:29:10 AM UTC-7, Rich Siegel wrote:
>
>
> If you aren't too proud to use Markdown(*), you can make this 
> work as follows: 


Thanks Rich! I am not sure what 0;" kind:d means, but it is working great. 
And I can whuff up my own CLM to tie to a file like this for the things I 
need to do.

Much appreciated,

-SiP 

-- 
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: "tags" file for Text Completion

2019-04-19 Thread Scott in Pollock


On Friday, April 19, 2019 at 8:09:05 AM UTC-7, Patrick Woolsey wrote:
>
> May I ask how large this set of names is? 


1480 and counting. I was concerned about having this many clippings lying 
around so that is why I started looking at a tags file. 

-- 
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: "tags" file for Text Completion

2019-04-19 Thread Patrick Woolsey
On 4/17/19 at 5:08 AM, scottinpoll...@gmail.com (Scott in Pollock) wrote:

> Would someone be so kind as to offer up a simple example of a "tags" file 
> for text completion with Text File? I have been using clippings for this 
> but have a large group of proper names that would be much more convenient 
> in a single file.
>

May I ask how large this set of names is?


Regards,

  Patrick Woolsey
==
Bare Bones Software, Inc. 

-- 
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: "tags" file for Text Completion

2019-04-19 Thread Patrick Woolsey

On 4/19/19 at 9:06 AM, list.bbe...@munkynet.org (Sam Hathaway) wrote:


I wonder if BBEdit doesn’t read tags files for “Text File” because it’s not a 
programming language?



That is indeed the case; there is no tag format nor any tags 
generator for human language content (or arbitrary plain text). :-)




Maybe Rich or Patrick can ring in. Or tell us if there’s another way to 
bulk-add completions.



In general, clippings are the appropriate solution for this 
purpose (or depending on one's specific needs, perhaps an 
external auto-typer app).



Regards,

  Patrick Woolsey
==
Bare Bones Software, Inc. 

--
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-19 Thread Rich Siegel
On 4/19/19 at 8:53 AM, tedmaster...@gmail.com (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)?


Give the "Extract" button in the multi-file search window a try. 
It may get you closer to what you're looking for.


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

2019-04-19 Thread Sam Hathaway
I know this isn’t exactly what you’re asking about, but I wanted to 
suggest using a tool that’s designed to work with XML rather than with 
line-oriented text.


One such tool is 
[xml_grep2](https://metacpan.org/pod/distribution/App-xml_grep2/bin/xml_grep2).


Installing it on macOS is a little involved so you may not want to do 
it, but if you're interested here's how I did it:


```
/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"

brew install cpanminus libxml2
export LDFLAGS="-L/usr/local/opt/libxml2/lib"
export CPPFLAGS="-I/usr/local/opt/libxml2/include"
export PKG_CONFIG_PATH="/usr/local/opt/libxml2/lib/pkgconfig"
cpanm App::Xml_grep2
```

Eventually, you should be able to run xml_grep2:

```
xml_grep2 --hR --text-only '//DataItem' * | bbedit
```

You can pipe that output to grep if you want to further filter the tag 
contents:


```
xml_grep2 --hR --text-only '//DataItem' * | grep -oE 
'(\{|\[)\s*[a-z]+\s*([0-9]+)\s*(\|.+?)?(\}|\])' | bbedit

```

Hope this helps! :-)
-sam

On 19 Apr 2019, at 8:53, Gustave Stresen-Reuter wrote:


Hi,

Given I've got dozens of folders with more than 1GB of XML documents 
in

them, I'm doing the following grep search from the command line:

grep -h -o -R -E '(\{|\[)\s*[a-z]+\s*([0-9]+)\s*(\|.+?)?(\}|\])' * | 
bbedit


I'm then removing duplicates and sorting. This gives me a very nice 
list of

the data I'm looking for. However, it also includes data that is not
wrapped in specific XML elements. Since grep only does line by line 
search

(processes each line of input) and since the XML elements span several
lines, I'm hoping I can use BBEdit to do the search, something like:

(?ms)(?\)(\{|\[)\s*[a-z]+\s*([0-9]+)\s*(\|.+?)?(\}|\])(?\<\/DataItem\>)

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)? I am fairly certain that the data I am looking 
for
(everything between [ or { and } or ]) does not span multiple lines 
(and if

it does it is a mistake on the input so it can be ignored).

I know I can fiddle with the IFS and do tricks like tr \n '' to put
everything onto a single line, but those create other problems of 
their own.


I know awk can do something similar but if I've understood what I've 
seen
online, it only simulates multiline search by using a loop (and I find 
the
syntax to be way, way too hard to follow in spite of how powerful it 
is,

so, not really a choice for me).

Any help is greatly appreciated.

Kind regards from the Canary Islands.

Ted Stresen-Reuter

--
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: "tags" file for Text Completion

2019-04-19 Thread Sam Hathaway
I wonder if BBEdit doesn’t read tags files for “Text File” because 
it’s not a programming language?


Maybe Rich or Patrick can ring in. Or tell us if there’s another way 
to bulk-add completions.


Good luck!
-sam

On 19 Apr 2019, at 8:59, Scott in Pollock wrote:


On Thursday, April 18, 2019 at 4:16:43 PM UTC-7, Sam Hathaway wrote:


and then copy the resulting tags file to wherever it is that BBEdit 
wants

it.



Hmmm the file seems to have been created successfully, but I can't 
get

it to work.

BBEdit says "the Completion Data folder contains tags files. These 
tags

files should be placed in subfolders corresponding to their languages
(found in ). For example, the subfolder containing a Python tags file 
must

be named “Python”."

I created a subfolder named "Text File" and put the "tags" file in it, 
then
restarted BBEdit, and opened a text file. None of my entries are 
visible in

the Completion popup.

--
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: "tags" file for Text Completion

2019-04-19 Thread Scott in Pollock
On Thursday, April 18, 2019 at 4:16:43 PM UTC-7, Sam Hathaway wrote:
>
> and then copy the resulting tags file to wherever it is that BBEdit wants 
> it.
>

Hmmm the file seems to have been created successfully, but I can't get 
it to work. 

BBEdit says "the Completion Data folder contains tags files. These tags 
files should be placed in subfolders corresponding to their languages 
(found in ). For example, the subfolder containing a Python tags file must 
be named “Python”."

I created a subfolder named "Text File" and put the "tags" file in it, then 
restarted BBEdit, and opened a text file. None of my entries are visible in 
the Completion popup.

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


How to get truncated output from RegEx search

2019-04-19 Thread Gustave Stresen-Reuter
Hi,

Given I've got dozens of folders with more than 1GB of XML documents in
them, I'm doing the following grep search from the command line:

grep -h -o -R -E '(\{|\[)\s*[a-z]+\s*([0-9]+)\s*(\|.+?)?(\}|\])' * | bbedit

I'm then removing duplicates and sorting. This gives me a very nice list of
the data I'm looking for. However, it also includes data that is not
wrapped in specific XML elements. Since grep only does line by line search
(processes each line of input) and since the XML elements span several
lines, I'm hoping I can use BBEdit to do the search, something like:

(?ms)(?\)(\{|\[)\s*[a-z]+\s*([0-9]+)\s*(\|.+?)?(\}|\])(?\<\/DataItem\>)

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)? I am fairly certain that the data I am looking for
(everything between [ or { and } or ]) does not span multiple lines (and if
it does it is a mistake on the input so it can be ignored).

I know I can fiddle with the IFS and do tricks like tr \n '' to put
everything onto a single line, but those create other problems of their own.

I know awk can do something similar but if I've understood what I've seen
online, it only simulates multiline search by using a loop (and I find the
syntax to be way, way too hard to follow in spite of how powerful it is,
so, not really a choice for me).

Any help is greatly appreciated.

Kind regards from the Canary Islands.

Ted Stresen-Reuter

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