Re: (probably :-) GREP-question regarding Photos-metadata

2020-03-16 Thread Jan Erik Moström
On 16 Mar 2020, at 13:57, Jan Erik Moström wrote: On 16 Mar 2020, at 7:50, Vlad Ghitulescu wrote: I couldn't get to any IPTC-metadata through Spotlight: This is something where you should use a tool like https://exiftool.org And if you want some kind of DAM tool then I would suggest looki

Re: (probably :-) GREP-question regarding Photos-metadata

2020-03-16 Thread Jan Erik Moström
On 16 Mar 2020, at 7:50, Vlad Ghitulescu wrote: > I couldn't get to any IPTC-metadata through Spotlight: This is something where you should use a tool like https://exiftool.org = jem -- This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, p

Re: (probably :-) GREP-question regarding Photos-metadata

2020-03-16 Thread Vlad Ghitulescu
Hi, Scott! Yes, it looks like I'm out of luck! ;-) Thanks anyway! Regards, Vlad On 15 Mar 2020, at 17:31, Scott in Pollock wrote: It may be possible, but I have yet to get it to work with AppleScript in Hi-C Error, despite trying some supposedly working examples on the web. This is not

Re: (probably :-) GREP-question regarding Photos-metadata

2020-03-15 Thread Scott in Pollock
It may be possible, but I have yet to get it to work with AppleScript in Hi-C Error, despite trying some supposedly working examples on the web. This is not surprising as the examples are pretty old (from back when tags started in Mavericks), and Apple has a history of breaking AppleScript stuf

Re: (probably :-) GREP-question regarding Photos-metadata

2020-03-15 Thread 'Jeffrey Jones' via BBEdit Talk
Vlad, I don't understand what you are trying to accomplish. Why do you want to use Finder Tags when photo files already have a standard tagging system, IPTC, built in? JPEG, TIFF, PNG, HEIF all contain IPTC in the file. (I don't know about Canon, but Nikon raw files also contain IPTC.) There is

Re: (probably :-) GREP-question regarding Photos-metadata

2020-03-15 Thread Vlad Ghitulescu
Scott, Thank you for your reply! First the very short answers: - I did bought a proper cataloging tool (and would probably buy another one soon :-) - none of the Digital Assets Managements - tool I tested can copy IPTC-keywords into Finder-tags. Now with more details: Just last week I fini

Re: (probably :-) GREP-question regarding Photos-metadata

2020-03-14 Thread Scott in Pollock
Vlad, While I am sure this is doable in AppleScript and or Automator, my initial tests here show it will be slow as all get out (filtering folder contents on file extension, and setting finder labels, reiteratively). Why not just get a proper cataloging tool like NeoFinder: https://www.cdfinde

Re: (probably :-) GREP-question regarding Photos-metadata

2020-03-14 Thread Scott in Pollock
Vlad, While I am sure this is doable in AppleScript and or Automator, my initial tests here show it will be slow as all get out (filtering folder contents on file extension, and setting finder labels, reiteratively). Why not just get a proper cataloging tool like [url=https://www.cdfinder.de/e

Re: (probably :-) GREP-question regarding Photos-metadata

2020-03-14 Thread Vlad Ghitulescu
GP, thanks for your detailled email. No, I didn't knew that the EXIFtool parse the XMP file data. (Now that you said this it seems obvious to me too - I thought initially that the EXIFtool will somehow read the photo-file, but that's nonsense, since the IPTC-data is in the XMP-file ant not in t

Re: (probably :-) GREP-question regarding Photos-metadata

2020-03-14 Thread GP
Do you know "the EXIFtool, a command line utility" is just a wrapper for a perl module you can download the source code for from CPAN? If you dig down into the perl source code you'll find the regular expressions used by EXIFtool to parse XMP file data. Since BBEdit uses the PCRE library for

Re: (probably :-) GREP-question regarding Photos-metadata

2020-03-14 Thread Vlad Ghitulescu
I run the little piece of AppleScript below supplemented with a loop within the xmpFiles (only to see that I'm able to loop… now at least you see that I don't know exactly what I'm doing! ;-): --- -- we can check the file extensions of a file against this list to evaluate if it's a XMP file

Re: (probably :-) GREP-question regarding Photos-metadata

2020-03-14 Thread Vlad Ghitulescu
I've found [here on StackOverflow][1] how to: - choose a folder - filter only the XMP-files - store the name of the XMP-files in an array Here's the modified part of the AppleScript: --- -- we can check the file extensions of a file against this list to evaluate if it's a XMP file s

Re: (probably :-) GREP-question regarding Photos-metadata

2020-03-14 Thread Vlad Ghitulescu
Jean-Christophe, thanks a lot for your reply! Google-ing (see my first email) I've found already [the very same AppleScript from Shane Stanley back in 2002 (!)][1] - so yes, that's another puzzle piece! Hurray! :-) I'm still missing a lot: 1. I don't know how to peek the first XMP-file in

Re: (probably :-) GREP-question regarding Photos-metadata

2020-03-14 Thread Jean-Christophe Helary
Vlad, You're just a few AppleScript lines away from solving your project. The problem is that Finder's dictionary does *not* provide access to "modern" tags. So we have to code that with AS but we don't have to reinvent the wheel since Shane Stanley has already written *the* code that you can u

Re: (probably :-) GREP-question regarding Photos-metadata

2020-03-13 Thread Vlad Ghitulescu
Maarten, thanks for your quick reply! I mentioned grep because I'd like to search for the keywords that are recognizable due to the rfd:li - tags in the XMP-file AND also because this is something I *suppose* it's easy to do with grep in BBEdit (even if it's still out of my reach :-)… as wel

Re: (probably :-) GREP-question regarding Photos-metadata

2020-03-13 Thread Maarten Sneep
Hi, If you need to work with xml I recommend to use a real xml parser. I prefer to use python with lxml. It will allow you to exploit the hierarchy of the xml file in ways that grep will not allow you to do. Best, Maarten > On 2020-03-13, at 13:44, Vlad Ghitulescu wrote: > > I was inexact r

Re: (probably :-) GREP-question regarding Photos-metadata

2020-03-13 Thread Vlad Ghitulescu
I was inexact regarding file-names and -number: - the XMP-file and the photo-file have the same name AND - there is most of the time **more than one photo-file**, because I shoot in RAW (that’s CR2 for me, shooting Canon) and all of the edited versions are JPG, once in a while TIFF. So for a

(probably :-) GREP-question regarding Photos-metadata

2020-03-13 Thread Vlad Ghitulescu
Hey! This is a BBEdit-question, but I first need to give a little background to it. :-) As all photographers here already know, the metadata to the photos lives in a suplimentary XMP-file. Here is a sample of a XMP-file for one of my photos, where I filled in the so called *IPTC-keywords* i

Re: Grep Question

2020-01-05 Thread Jimmbo
[fletcher], Yup, that works, thanks! The other suggestions fwiw do not. On Tuesday, December 31, 2019 at 3:33:17 PM UTC-5, flet...@cumuli.com wrote: > > I think the [^>] is matching the newline/return at the end of the line. > The "Pattern Playground" on the search menu lets you see what BBEdit

Re: Grep Question

2019-12-31 Thread ThePorgie
Oops. Do Match if ">" is not at the end of a line: [^>]$ On Tuesday, December 31, 2019 at 6:06:34 PM UTC-5, ThePorgie wrote: > > I think if you want the lines that don't end with the ">" you might want > something like this > > ^.+[^>]$ > > Start match at new line: ^ > Match any character one or

Re: Grep Question

2019-12-31 Thread ThePorgie
I think if you want the lines that don't end with the ">" you might want something like this ^.+[^>]$ Start match at new line: ^ Match any character one or more times: .+ Don't Match if ">" is at the end of a line: [^>]$ Let me know if that is what you're looking for. On Tuesday, December 31,

Re: Grep Question

2019-12-31 Thread Fletcher Sandbeck
I think the [^>] is matching the newline/return at the end of the line. The "Pattern Playground" on the search menu lets you see what BBEdit is matching. This seems to do what you want. [^>\r\n]$ Something to do with $ being a zero length look-ahead assertion maybe... [fletcher] > On Dec 31,

Re: Grep Question

2019-12-31 Thread Jean-Christophe Helary
> On Jan 1, 2020, at 5:11, Jimmbo wrote: > > Can anyone suggest a Grep pattern for finding lines that don't end with a > closing HTML symbol (>)? > > This doesn't work for some mysterious reason: [^>]$ Can you copy a line that seems to not work ? Jean-Christophe Helary --

Grep Question

2019-12-31 Thread Jimmbo
Can anyone suggest a Grep pattern for finding lines that don't end with a closing HTML symbol (>)? This doesn't work for some mysterious reason: [^>]$ -- This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "supp...@barebones.c

Re: GREP question

2019-12-19 Thread Howard Rosenberg
Thanks. On Dec 19, 2019, 1:53 PM -0500, Fletcher Sandbeck , wrote: > You can think of the pattern as a state machine. It scans forward in the > input until the first match in the pattern. In this case the first match is > the first "a" in the input so that's where the match starts. The rest of th

Re: GREP question

2019-12-19 Thread Sam Hathaway
What Fletcher said. :-) On 19 Dec 2019, at 13:53, Fletcher Sandbeck wrote: You can think of the pattern as a state machine. It scans forward in the input until the first match in the pattern. In this case the first match is the first "a" in the input so that's where the match starts. The rest

Re: GREP question

2019-12-19 Thread Fletcher Sandbeck
You can think of the pattern as a state machine. It scans forward in the input until the first match in the pattern. In this case the first match is the first "a" in the input so that's where the match starts. The rest of the pattern tells it how far to extend the match, through the next "b".

Re: GREP question

2019-12-19 Thread Howard Rosenberg
Sam, Why does the pattern .*?b only match aaab and not aab? Isn’t aab the shortest string possible? Howard On Dec 19, 2019, 1:17 PM -0500, bbedit@googlegroups.com, wrote: > > The pattern .*b will match aaabaab, while the pattern .*?b will match aaab. -- This is the BBEdit Talk public discussio

Re: GREP question

2019-12-19 Thread Sam Hathaway
Putting a `?` after a quantifier like `*` or `+` indicates that you want it to be _lazy_ instead of _greedy_. In short, this means that the quantifier will match the shortest string possible rather than the longest string possible. For example, take the text `aaabaaba`. The pattern `.*b` will

Re: GREP question

2019-12-19 Thread Fletcher Sandbeck
The question mark after the + makes it non-greedy so it won't match the character immediately following. However, in this case you're matching until the end of the line so I don't think it does anything. Compare these two patterns matched against the input. The ? after the + prevents the match

Re: GREP question

2019-12-19 Thread ThePorgie
The Question Mark makes the previous optional I think it would make more since written like this using "Zero or More" vs "One or More". Don't think you'd need the Dollar Sign. Just my 2¢ \\.* On Thursday, December 19, 2019 at 12:00:20 PM UTC-5, Howard wrote: > > I am new both to BBEdit and to G

GREP question

2019-12-19 Thread Howard
I am new both to BBEdit and to GREP and have a question about this GREP code: \\.+?$ It is used in Search's Find box to remove all text from the backslash on, and is accompanied by no value in the Replace box. *Sample Input* Tyler Rogers\rogerty01 *Desired Output* Tyler Rogers I understand t

Re: GREP question: how to find and remove tags in XML document

2019-05-13 Thread Rod Buchanan
Find: Replace: Only issue would be if there are tags that contain additional non-blank data after content, e.g. ? On May 12, 2019, at 2:26 PM, cosmo wrote: > > > > On Sunday, May 12, 2019 at 8:46:16 PM UTC+2, Christopher Stone wrote: > > BBEdit Menu > Markup > Utilities > Translate HTML

Re: GREP question: how to find and remove tags in XML document

2019-05-13 Thread cosmo
Morning everyone, first of all apologies if my initial posts wasn't specific enough and my first replies came across as unpolite, i've had some rather frustrating forum experiences last week and think i might have inadvertently slipped into 'oh no not again'-mode, and clearly this is not that :

Re: GREP question: how to find and remove tags in XML document

2019-05-12 Thread Christopher Stone
On 05/12/2019, at 17:04, Bruce Linde mailto:bli...@5happy.com>> wrote: > you specifically said: "So i need to remove the tags > entirely but preserve the content and tags WITHIN these elements, is this at > all possible with grep in bbedit ?" > > my solution does just that. I meant to mention

Re: GREP question: how to find and remove tags in XML document

2019-05-12 Thread Christopher Stone
On 05/12/2019, at 14:30, cosmo mailto:cosmopolyt...@gmail.com>> wrote: > Just to clarify, i am looking for a way to find and delete specific tags ONLY > while preserving all other tags, including those contained WITHIN the tags i > want to remove. So for the above example the output i'm looking f

Re: GREP question: how to find and remove tags in XML document

2019-05-12 Thread Bruce Linde
you specifically said: "So i need to remove the tags entirely but preserve the content and tags WITHIN these elements, is this at all possible with grep in bbedit ?" my solution does just that. if a yutz like me and a monster like christopher are both unclear on what you're looking to accompl

Re: GREP question: how to find and remove tags in XML document

2019-05-12 Thread cosmo
just to clarify, i am loohing for a way to find and delete specific tags ONLY while preserving all other tags, including those contained WITHIN the tags i want to remove. So for the above example the output i'm looking for is: Original Markup: Some text content here. Processed markup: So

Re: GREP question: how to find and remove tags in XML document

2019-05-12 Thread Bruce Linde
wait - i re-read your problem statement and read it as removing the structured-content tags and attributes only... is that correct? if so, this will remove all opening and closing structured-content tags and their attributes only and leave everything else: <\/*structured-content[^>]*> "find an

Re: GREP question: how to find and remove tags in XML document

2019-05-12 Thread Christopher Stone
On 05/12/2019, at 14:26, cosmo mailto:cosmopolyt...@gmail.com>> wrote: > thx for answering but it seems you did not read my post, i don't want to > convert the xml to text or remove all tags ... i need to find and delete > SPECIFIC tags WHILE PRESERVING ALL OTHER TAGS Hey Cosmo, Clearly I did

Re: GREP question: how to find and remove tags in XML document

2019-05-12 Thread cosmo
On Sunday, May 12, 2019 at 8:46:16 PM UTC+2, Christopher Stone wrote: > > > BBEdit Menu > Markup > Utilities > Translate HTML to Text > > If you need to resort to a RegEx then try this: > > Find: <[^>]+?> > > Replace: Nothing. > > > thx for answering but it seems you did not read my post, i don'

Re: GREP question: how to find and remove tags in XML document

2019-05-12 Thread Christopher Stone
On 05/12/2019, at 03:54, cosmo mailto:cosmopolyt...@gmail.com>> wrote: > Trying to wrap my head around grep to accomplish this … Hey Cosmo, The first thing to try is: BBEdit Menu > Markup > Utilities > Translate HTML to Text If you need to resort to a RegEx then try this: Find: <[^>]+?> Rep

GREP question: how to find and remove tags in XML document

2019-05-12 Thread cosmo
Hi everyone, trying to wrap my head around grep to accomplish this: i have several very large XML docs and need to remove some tags from them (just the tags and attributes, not the content inside the tags). There is just too much to do this manually so i'm wondering if this is possible with BBe

Re: Grep question

2018-10-08 Thread Cory Robertson
Marek, this worked great and thank you for explaining it to me as well. On Mon, Oct 8, 2018 at 12:25 PM Marek Stepanek < ms...@podiuminternational.org> wrote: > On 08.10.18 20:22, Cory Robertson wrote: > > I would like to find all instances of [2:52 PM] (but with any time in > > the brackets) and

Re: Grep question

2018-10-08 Thread Bucky Junior
> On Oct 8, 2018, at 12:22 PM, Cory Robertson > wrote: > > \[*\] Cory, you were searching for \[* - literal left bracket, zero or more Immediately followed by \] - literal right bracket Grep didn’t find the two next to each other but did find zero instances of left bracket and right

Re: Grep question

2018-10-08 Thread Marek Stepanek
On 08.10.18 20:22, Cory Robertson wrote: > I would like to find all instances of [2:52 PM] (but with any time in > the brackets) and delete them.  > > I have so far figured out using \[*\] seems to find them but I can't > figure out how to delete them, it just wants to delete the trailing ] > clos

Re: Grep question

2018-10-08 Thread Mark McLeod
Try this: \[\d\d\:\d\d] And leave the replacement area blank. > On Oct 8, 2018, at 2:22 PM, Cory Robertson wrote: > > I would like to find all instances of [2:52 PM] (but with any time in the > brackets) and delete them. > > I have so far figured out using \[*\] seems to find them

Grep question

2018-10-08 Thread Cory Robertson
I would like to find all instances of [2:52 PM] (but with any time in the brackets) and delete them. I have so far figured out using \[*\] seems to find them but I can't figure out how to delete them, it just wants to delete the trailing ] close bracket. -- This is the BBEdit Talk public d

Re: Help with a grep question

2018-02-04 Thread Christopher Stone
On 01/26/2018, at 20:56, Doug Lerner mailto:d...@lerner.net>> wrote: > What I would like to do is find everything between the ID_User_ and *-find > (e.g. .5a82483a in this example) and be left with a file where each line > contains just that userId. After that I can sort it, remove duplicates, e

Re: Help with a grep question

2018-01-28 Thread Dave
Enter one of these patterns in a Find dialog: (?<=ID_User=)\.[[:xdigit:]]+(?=&-find) or (?<=ID_User=)\.[[:alnum:]]+(?=&-find) (Which pattern depends on whether the ID is a hexadecimal number or simply a sequence of alphanumeric characters.) Click Extract. A new document containing the IDs will be

Re: Help with a grep question

2018-01-27 Thread Fletcher Sandbeck
Select "Process Lines Containing" from the Text menu. Use an expression like "ID_User" and the "Copy to new document" option. This will create a new document that contains only lines that you want to process. Then a simple replace all should do the actual work. Find: .*ID_User=(.+?)&.*\r Replac

Help with a grep question

2018-01-27 Thread Doug Lerner
Hi. I am using BBEdit 11.6.8 and have a file with thousands of lines, where most lines contain an expression that looks like this: ID_User=.5a82483a&-find There's other stuff on the line too. What I would like to do is find everything between the ID_User_ and *-find (e.g. .5a82483a in this exa

Re: Grep question: Replacing data that do not match criterion

2011-01-29 Thread LuKreme
On 27-Jan-2011, at 22:22, steveax wrote: > >> $tldn = '(com|net|edu|gov|int|mil|org|biz|name|coop|aero|info|[a-z][a-z])'; >> #most valid top level domains > > That list is a bit out of date these days, no? Maybe, but I use (com|net|org|edu) and that catches everything I see. -- This is to sa

Re: Grep question: Replacing data that do not match criterion

2011-01-28 Thread Bucky Junior
On Jan 28, 2011, at 1:08 PM, John Delacour wrote: > At 13:32 -0500 28/01/2011, you wrote: > >> On Thu, Jan 27, 2011 at 09:22:43PM -0800, steveax wrote: >>> > $tldn = >>> > '(com|net|edu|gov|int|mil|org|biz|name|coop|aero|info|[a-z][a-z])'; #most >>> > valid top level domains >>> >>> That list

Re: Grep question: Replacing data that do not match criterion

2011-01-28 Thread Ronald J Kimball
On Fri, Jan 28, 2011 at 08:08:10PM +, John Delacour wrote: > At 13:32 -0500 28/01/2011, you wrote: > > >What tlds is it missing that you expect to see? > > Perhaps just one or two token entries to acknowledge the existence of > a whole universe beyond the oily shores of the United States ?

Re: Grep question: Replacing data that do not match criterion

2011-01-28 Thread Steve Piercy
On Jan 27, 9:22 pm, steveax wrote: > > $tldn = '(com|net|edu|gov|int|mil|org|biz|name|coop|aero|info|[a-z][a-z])'; > >  #most valid top level domains > > That list is a bit out of date these days, no? You could look to this page for inspiration. The discussion is pretty thorough. http://www.reg

Re: Grep question: Replacing data that do not match criterion

2011-01-28 Thread William Reveal
Doesn't the [a-z][[a-z] recognize all 2 letter country codes out there which is at this time the rest of the TLDs? Bill?'''? ( o o ) o00 ( ) 00o- \ O / @@@ On Jan 28, 2011, at 2:08 PM, John Delacour wrote: > At 13:32 -0500 28/01/2011

Re: Grep question: Replacing data that do not match criterion

2011-01-28 Thread John Delacour
At 13:32 -0500 28/01/2011, you wrote: On Thu, Jan 27, 2011 at 09:22:43PM -0800, steveax wrote: > $tldn = '(com|net|edu|gov|int|mil|org|biz|name|coop|aero|info|[a-z][a-z])'; #most valid top level domains That list is a bit out of date these days, no? What tlds is it missing that you expec

Re: Grep question: Replacing data that do not match criterion

2011-01-28 Thread Matt Martini
Well, I could've added the following new tlds however, I really wasn't trying to make an exhaustive list. arpa|asia|cat|jobs|mobi|museum|pro|tel|travel My original list will probably capture 95%+ for emails. Matt On Jan 28, 2011, at 1:32 PM, Ronald J Kimball wrote: > On Thu, Jan 27, 2011

Re: Grep question: Replacing data that do not match criterion

2011-01-28 Thread Ronald J Kimball
On Thu, Jan 27, 2011 at 09:22:43PM -0800, steveax wrote: > > $tldn = '(com|net|edu|gov|int|mil|org|biz|name|coop|aero|info|[a-z][a-z])'; > > #most valid top level domains > > That list is a bit out of date these days, no? What tlds is it missing that you expect to see? Ronald -- You received

Re: Grep question: Replacing data that do not match criterion

2011-01-27 Thread steveax
> $tldn = '(com|net|edu|gov|int|mil|org|biz|name|coop|aero|info|[a-z][a-z])'; > #most valid top level domains That list is a bit out of date these days, no? -- You received this message because you are subscribed to the "BBEdit Talk" discussion group on Google Groups. To post to this group, s

Re: Grep question: Replacing data that do not match criterion

2011-01-27 Thread Doug Pinkerton
Thanks, Matt. I'll experiment with this. *** On Jan 27, 2011, at 3:31 PM , Matt Martini wrote: Doug, First you save the program to a file, let's say extract_email_addresses.pl Then you can use this perl program two ways: 1) If you are com

Re: Grep question: Replacing data that do not match criterion

2011-01-27 Thread Matt Martini
Doug, First you save the program to a file, let's say extract_email_addresses.pl Then you can use this perl program two ways: 1) If you are comfortable with the command line (via Terminal.app) you can utilize it this way: $ cat file_of_data | perl extract_email_addresses.pl > file_of_emai

Re: Grep question: Replacing data that do not match criterion

2011-01-27 Thread LuKreme
On 27-Jan-2011, at 12:28, Doug Pinkerton wrote: > I know nothing about Perl. Is this nicely terse? : ) It's almost readable, so no. :) -- 'Charity ain't giving people what you wants to give, it's giving people what they need to get.' -- You received this message because you are subscribed

Re: Grep question: Replacing data that do not match criterion

2011-01-27 Thread Doug Pinkerton
I know nothing about Perl. Is this nicely terse? : ) *** On Jan 27, 2011, at 1:01 PM , Matt Martini wrote: Doug, Sorry to be so late to the party, but this works well: #!/usr/bin/perl $tldn='(com|net|edu|gov|int|mil|org|biz|name|coop|aer

Re: Grep question: Replacing data that do not match criterion

2011-01-27 Thread Matt Martini
Doug, Sorry to be so late to the party, but this works well: #!/usr/bin/perl $tldn='(com|net|edu|gov|int|mil|org|biz|name|coop|aero|info|[a-z][a-z])'; while(chomp($line=<>)) { while($line =~ m{<(\w[-.\w]*\@[-a-z0-9]+(\.[-a-z0-9]+)*\.$tldn)>}g) { print $1 . "\n"; } } Thanks to

Re: Grep question: Replacing data that do not match criterion

2011-01-26 Thread LuKreme
On 26-Jan-2011, at 05:31, Doug Pinkerton wrote: > > I need to extract email addresses from a file. Fortunately, the email > addresses are in angle brackets . I have no problem > matching that pattern. But I need to match everything BUT that pattern and > replace with nothing, so that only the e

Re: Grep question: Replacing data that do not match criterion

2011-01-26 Thread Doug Pinkerton
Thanks to both of you for workable solutions. I never realized what a rich resource this list was. *** On Jan 26, 2011, at 10:15 AM , Robert A. Rosenberg wrote: Why not find >...< and replace it with a new line? That will leave you with the

Re: Grep question: Replacing data that do not match criterion

2011-01-26 Thread Robert A. Rosenberg
At 07:41 -0600 on 01/26/2011, Doug Pinkerton wrote about Re: Grep question: Replacing data that do not match criteri: >> On Jan 26, 2011, at 06:31, Doug Pinkerton wrote: >> I need to extract email addresses from a file. Fortunately, the email addresses are in angle brackets

Re: Grep question: Replacing data that do not match criterion

2011-01-26 Thread Ronald J Kimball
On Wed, Jan 26, 2011 at 06:31:31AM -0600, Doug Pinkerton wrote: > I need to extract email addresses from a file. Fortunately, the email > addresses are in angle brackets . I have no problem > matching that pattern. But I need to match everything BUT that pattern > and replace with nothing, so that

Re: Grep question: Replacing data that do not match criterion

2011-01-26 Thread Roland Küffner
Hi, I would do this in two steps. 1) find: <|> replace with \r 2) Process lines containing (with "copy to new document") ^[^@]+@[^@]+$ To make this a one-step-action: put it in a text factory ;-) Regards, Roland Am 26.01.2011 um 15:19 schrieb Ted Burger: > Oops should have been: > > Doug,

Re: Grep question: Replacing data that do not match criterion

2011-01-26 Thread Doug Pinkerton
Wow. This is a bigger deal than I thought. I should also have mentioned that I need to document the steps and pass them along to a coworker, who will be doing this job in Text Wrangler. So this solution is too much overhead when I can get the job done with two find and replace steps. I appreciat

Re: Grep question: Replacing data that do not match criterion

2011-01-26 Thread Christopher Stone
On Jan 26, 2011, at 07:41, Doug Pinkerton wrote: > Thanks, Chris. Unfortunately, the email addresses are not on lines by > themselves, so "Process lines containing..." copies all of the data on the > line. The result is simply a copy of the original document. Strictly > speaking, although I view

Re: Grep question: Replacing data that do not match criterion

2011-01-26 Thread Mark
26 jan 2011 kl. 14.41 skrev Doug Pinkerton: >>> On Jan 26, 2011, at 06:31, Doug Pinkerton wrote: >>> I need to extract email addresses from a file. Fortunately, the email >>> addresses are in angle brackets . I have no problem >>> matching that pattern. But I need to match everything BUT that p

Re: Grep question: Replacing data that do not match criterion

2011-01-26 Thread Doug Pinkerton
Thanks, Ted. That gets it. *** On Jan 26, 2011, at 8:19 AM , Ted Burger wrote: Oops should have been: Doug, Without seeing the source file it is a bit tricky to help. Do it in a couple of steps. In BBedit search Replace all > with a CR (

Re: Grep question: Replacing data that do not match criterion

2011-01-26 Thread Ted Burger
Oops should have been: Doug, Without seeing the source file it is a bit tricky to help. Do it in a couple of steps. In BBedit search Replace all > with a CR (backslash r) Replace all ^.*< with nothing using grep Thanks, Ted *** Ted Burger t...

Re: Grep question: Replacing data that do not match criterion

2011-01-26 Thread Doug Pinkerton
Thanks, Ted. But that doesn't work as the first step results in lines starting with commas. The file pattern is like this: John Doe , Bill Smith , Jim Jones ... and so forth. There are 170 entries on a single line. I've done it before by replacing [, ] with \r to break it into separate lines,

Re: Grep question: Replacing data that do not match criterion

2011-01-26 Thread Ted Burger
Chris, Without seeing the source file it is a bit tricky to help. Do it in a couple of steps. In BBedit search Replace all > with a CR (backslash r) Replace all ^< with nothing using grep Thanks, Ted *** Ted Burger t...@tobsupport.com

Re: Grep question: Replacing data that do not match criterion

2011-01-26 Thread Doug Pinkerton
>> On Jan 26, 2011, at 06:31, Doug Pinkerton wrote: >> I need to extract email addresses from a file. Fortunately, the email >> addresses are in angle brackets . I have no problem >> matching that pattern. But I need to match everything BUT that pattern and >> replace with nothing, so that only

Re: Grep question: Replacing data that do not match criterion

2011-01-26 Thread Christopher Stone
On Jan 26, 2011, at 06:31, Doug Pinkerton wrote: > I need to extract email addresses from a file. Fortunately, the email > addresses are in angle brackets . I have no problem > matching that pattern. But I need to match everything BUT that pattern and > replace with nothing, so that only the ema

Grep question: Replacing data that do not match criterion

2011-01-26 Thread Doug Pinkerton
I need to extract email addresses from a file. Fortunately, the email addresses are in angle brackets . I have no problem matching that pattern. But I need to match everything BUT that pattern and replace with nothing, so that only the email addresses remain. How do I perform a DOES NOT EQUAL s

Re: Basic grep question

2010-05-24 Thread Gabriel Roth
> > s -- By default, the magic dot metacharacter . matches any character except > return ("\r"). If you turn this option on with (?s) , however, dot will > match any character. Thus, the pattern (?s).+ will match an entire document. Thanks very much. -- You received this message because you are

Re: Basic grep question

2010-05-23 Thread Ronald J Kimball
On Sat, May 22, 2010 at 01:28:36PM -0700, Bill Rowe wrote: > On 5/22/10 at 12:15 PM, gabe.r...@gmail.com (Gabriel Roth) wrote: > > >Is there a grep special character that matches any character > >including a line break? I find myself using (\s|\S) and suspect that > >there must be a shorter way.

Re: Basic grep question

2010-05-22 Thread Bill Rowe
On 5/22/10 at 12:15 PM, gabe.r...@gmail.com (Gabriel Roth) wrote: Is there a grep special character that matches any character including a line break? I find myself using (\s|\S) and suspect that there must be a shorter way. From the grep reference in BBEdit Help menu s -- By default, the mag

Basic grep question

2010-05-22 Thread Gabriel Roth
Is there a grep special character that matches any character including a line break? I find myself using (\s|\S) and suspect that there must be a shorter way. -- You received this message because you are subscribed to the "BBEdit Talk" discussion group on Google Groups. To post to this group, se

Re: Beginner grep question. Optional minus find and replace

2010-05-20 Thread BBEdit user
Thanks. I must have been making some typo. But it works now. Thanks. Kendall: I appreciate the shortening. A step beyond where I was. -- 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@googl

Re: Beginner grep question. Optional minus find and replace

2010-05-20 Thread Kendall Conrad
Give this a try for the find. It worked for me. As a note, I simplified some of the pieces. ACTIVE LOG\d+ ([\d\.]+) (.*?) -Kendall On May 20, 4:00 pm, BBEdit user wrote: > I'm very much an amateur with grep. > > How do I find the optional minus and put it in the subpattern?

Re: Beginner grep question. Optional minus find and replace

2010-05-20 Thread Ronald J Kimball
On Thu, May 20, 2010 at 01:00:57PM -0700, BBEdit user wrote: > I'm very much an amateur with grep. > > How do I find the optional minus and put it in the subpattern? > > I want to grab the time in the following and then use it for the name. > Multiple names in the document. I seem to have it exce

Beginner grep question. Optional minus find and replace

2010-05-20 Thread BBEdit user
I'm very much an amateur with grep. How do I find the optional minus and put it in the subpattern? I want to grab the time in the following and then use it for the name. Multiple names in the document. I seem to have it except for finding the optional minus sign that can occur with ele, lat and l

Re: Probably the Most Basic GREP Question

2009-09-18 Thread Jeff Horn
Disclaimer: I don't use BBEdit. I use TextWrangler occasionally. I'm not sure what regular expression "syntax" it uses. I don't use grep that often either. Anyway, here is a free online tool to test out expressions you want to use. It's useful if you're learning new expressions. http://gskinner.

Probably the Most Basic GREP Question

2009-09-18 Thread xbsjason
I have a file and need to remove links from it. Can someone give me examples of how to do this. I need to remove one set of links (and the anchor text) and another set keeping the anchor text. Can someone give me a pointer, I really need to buckle down and wrap my head around this GREP stuff, t

Re: grep question

2009-07-02 Thread Semper Fidelis
Peter~ Using your notation where an underscore ("_") here represents a space, search for ... _([A-Z]{2})_(\d{5})_ ... and replace all that with ... \t\1\t\2\t Cheers, ~Semper Fi, Mac! = = = = = = = = = = = = = = = = = = = = On Jul 2, 2009, at 1:23 PM, Peter wrote: > > Im

grep question

2009-07-02 Thread Peter
Im new to grep and have what is probably a simple question: I have an text file containing the state and zip. AZ 85712 There is a space before the AZ and after the zip code. "_AZ_85712_" (_=space) How can i put tabs where the spaces are using GREP? Thanks in advance for your help! Peter --~

Re: newbie grep question

2008-11-12 Thread Paul
Thanks, Jonathan. I had completely overlooked that (?s), struggling with strings of \s and \r. Paul On Nov 12, 2:55 pm, Jonathan Lundell <[EMAIL PROTECTED]> wrote: > On Nov 12, 2008, at 11:28 AM, Paul wrote: > > > Two full days of experimenting, reading, expermenting, researching, > > experimen

Re: newbie grep question

2008-11-12 Thread Paul
Thank you, Patrick. It not only solves my problem but points me at the solution to some others *and* expands my knowledge for the future. Paul On Nov 12, 3:13 pm, Patrick Woolsey <[EMAIL PROTECTED]> wrote: > Paul <[EMAIL PROTECTED]> sez: > > >Two full days of experimenting, reading, expermentin

Re: newbie grep question

2008-11-12 Thread Patrick Woolsey
Paul <[EMAIL PROTECTED]> sez: >Two full days of experimenting, reading, expermenting, researching, >experimenting and I can't figure out how to get this done. > >I want to find and replace blocks like the following, using the > tags as delimiters. The problem seems to be that the >number of parag

Re: newbie grep question

2008-11-12 Thread Roland Küffner
One short addition: On Nov 12, 9:50 pm, Roland Küffner <[EMAIL PROTECTED]> wrote: > > (?s) beware that the term will not properly find corresponding opening and closing tags if you have nested divs in the outer divs (which isn't the case in your example). Roland --~--~-~--~~-

Re: newbie grep question

2008-11-12 Thread Jonathan Lundell
On Nov 12, 2008, at 11:28 AM, Paul wrote: > Two full days of experimenting, reading, expermenting, researching, > experimenting and I can't figure out how to get this done. > > I want to find and replace blocks like the following, using the > tags as delimiters. The problem seems to be that the

Re: newbie grep question

2008-11-12 Thread Roland Küffner
Hi Paul, this should do the job: (?s) (?s) allows the period to match line breaks. The term simply matches complete div tags. I hope this is what you wanted to achieve? happy greping Roland --~--~-~--~~~---~--~~ You received this message because you are subscr

newbie grep question

2008-11-12 Thread Paul
Two full days of experimenting, reading, expermenting, researching, experimenting and I can't figure out how to get this done. I want to find and replace blocks like the following, using the tags as delimiters. The problem seems to be that the number of paragraphs varies. You ha

  1   2   >