Re: A Question Derived from Converting decimal value

2022-03-16 Thread ThePorgie
Thank you sir! Don't know how I missed that in the manual and I promise I 
did look there first.

On Wednesday, March 16, 2022 at 4:13:30 PM UTC-4 Patrick Woolsey wrote:

> On 3/16/22 at 2:06 PM, thep...@gmail.com (ThePorgie) wrote:
>
> >I was tinkering with with Patrick's question
>
> Not actually my question ;-) though close enough for the matters 
> at hand.
>
>
> >So I was looking at this and knew it would have to be several 
> >passes, but my pattern I was working with for the first pass 
> >was "(?P\d+\.)1"
> >
> >My question is since I can't use a replace pattern \1 follow by 33
>
> You can in fact do this by prefixing a zero "0" to the singular 
> backreference number, so:
>
> Replace: \0133
>
> will give you the first backreference \01 followed by the string "33".
>
>
> >I was using a named pattern, but (?P=foo) doesn't call the named pattern
> >in the replace area of a grep search? Just curious as I couldn't find
> >anything regarding this in the manual.
>
> Please see the section titled "Subpatterns Make Replacement 
> Powerful" in Chapter 8 (page 202) of the current manual:
>
> Pattern Inserts
> =
> [...]
>
> \P the text matched by the subpattern NAME
>
>
> Regards,
>
> Patrick Woolsey
> ==
> Bare Bones Software, Inc. <https://www.barebones.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: <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/daa9a0b4-0151-4404-a775-ba345a104655n%40googlegroups.com.


A Question Derived from Converting decimal value

2022-03-16 Thread ThePorgie
I was tinkering with with Patrick's question regarding replacing the digits 
where the "n.1" is replaced with "n.33" and "n.2" is replaced with "n.67"
His sample data:
*Sample  Desired output*
0.20.67
1.11.33
1.11.33
1.21.67
1.11.33
66
3.2 3.67
88
6.2 6.67

So I was looking at this and knew it would have to be several passes, but 
my pattern I was working with for the first pass was "(?P\d+\.)1"
My question is since I can't use a replace pattern \1 follow by 33 I was 
using a named pattern, but (?P=foo) doesn't call the named pattern in the 
replace area of a grep search? Just curious as I couldn't find anything 
regarding this in the manual.

-- 
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/37810128-a19b-480d-aceb-5f67fb812d6en%40googlegroups.com.


Re: Patter crossing ne line boundary?

2022-03-01 Thread ThePorgie
The exception class will include the eol unless specifically told not to. 
You need to put a "\r" in your exception class.

I'd like to see a few more examples of your data but if you replace the 
exception class with a word character class it seems you might get what 
you're looking for
^,,([\w]+) ([\w]+),

On Tuesday, March 1, 2022 at 4:32:20 PM UTC-5 kre...@kreme.com wrote:

> I am using the following pattern:
>
> ^,,([^ ]+) ([^,@]+),
>
> And it is matching across the EOL markers. I though the default was for 
> pattern not to do that unless specifically told to?
>
> It is the [^ ]+ that seems to do it.
>
> What I am trying to match is a ",,word word," and not match ",,word,word"
>
> -- 
> You came in that thing? You're braver than I thought!
>
>

-- 
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/ecc95afd-dc0d-41a0-8b7e-927461c77cc4n%40googlegroups.com.


Re: Need GREP to reorder a list of names

2022-02-03 Thread ThePorgie
Find:
([^,\r]+), (.+)
Replace:
\2 \1

([^,\r]+)//finds everything but a comma or return
, //finds the comma space
(.+)//finds everything after the comma space
//Parentheses capture the two groups

\2 //Replace with found group 2 follow by a space
\1//Replace with found group 1
On Thursday, February 3, 2022 at 8:12:54 PM UTC-5 Howard wrote:

> *Here is a sample of the data I have in a column:*
> Guerrero Jr., Vladimir
> Perez, Salvador
> Machado, Manny
> Bichette, Bo
> Goldschmidt, Paul
> Devers, Rafael
> Judge, Aaron
> Freeman, Freddie
>
> *Desired output*
> For each name, I need all the characters after each comma moved to the 
> start of the name followed by a space and the comma removed so that the 
> names appear this way:
> Vladimir Guerrero Jr.
> Salvador Perez
> Manny Machado 
> Bo Bichette
> Paul Goldschmidt
> Rafael Devers 
> Aaron Judge
> Freddie Freeman 
>
> Thanks in advance for any help you can provide,
> Howard
>
>

-- 
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/331e0090-fe50-4ee1-99c6-3f275c82f4f0n%40googlegroups.com.


Re: How to have \D ignore newline character?

2021-12-13 Thread ThePorgie
Much prettier & easier to read sirWell played.

On Monday, December 13, 2021 at 2:19:51 PM UTC-5 listmei...@gmail.com wrote:

> On Dec 12, 2021, at 23:38, Tim A  wrote:
>
> Deepening the challenge, the phone numbers are actually in the second of 
> three columns separated by tabs. If I can get the phone numbers stripped I 
> can then impose a uniform format on them.
>
> --
>
> Hey Tim,
>
> Find:
>
> [(]?(\d{3})\D*(\d{3})\D*(\d{4})
>
> Replace:
>
> \1-\2-\3
>
>
> --
> 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 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/a737c258-cdae-4074-831b-51955fa3a9aen%40googlegroups.com.


Re: How to have \D ignore newline character?

2021-12-13 Thread ThePorgie

"...replacing the spaces in the tab areas..." Should of added "to simulate 
the text you describe."
On Monday, December 13, 2021 at 9:36:13 AM UTC-5 ThePorgie wrote:

> Pulling your text and replacing the spaces in the tab areas and then 
> Running the following
> (?:[- (\.\d]+)?(\d{3})(?:[- )\.]+)?(\d{3})(?:[- )\.]+)?(\d{4})
> with a replacement of
> \1-\2-\3
> yields the following
> Name1123-456-7890Single Lifetime
> Name2123-456-7890Joint Lifetime
> Name3123-456-7890Joint Lifetime
> Name4123-456-7890Single
> Name5123-456-7890Single
> Name6123-456-7890Single
> Name7123-456-7890Joint
> Name8123-456-7890Joint
>
> Is that what your looking for?
>
> On Monday, December 13, 2021 at 8:41:06 AM UTC-5 Tim A wrote:
>
>> *Try using a negative character class like [^\d\n\r] *
>> That will do it! .. and as an extra benefit catches any periods used as a 
>> delimiter as well.
>>
>> Deepening the challenge, the phone numbers are actually in the second of 
>> three columns separated by tabs. If I can get the phone numbers stripped I 
>> can then impose a uniform format on them. But how do I focus the 
>> find/replace on just this second column? I can do this in many small steps, 
>> but figure there must be an elegant way to do it in a single step.
>>
>> Before...
>>
>> Name11234567890Single Lifetime
>> Name2123-4567890Joint Lifetime
>> Name3123-456-7890Joint Lifetime
>> Name4(123)4567890Single
>> Name5(123) 4567890Single
>> Name6(123)-4567890Single
>> Name7(123)456-7890Joint
>> Name8123.456.7890Joint
>>
>> After...
>> Name11234567890SingleLifetime
>> Name21234567890JointLifetime
>> Name31234567890JointLifetime
>> Name41234567890Single
>> Name51234567890Single
>> Name61234567890Single
>> Name71234567890Joint
>> Name81234567890Joint
>>
>>
>>
>>
>>
>>

-- 
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/c82d1992-768c-4f68-9343-ad2b70b0ee7an%40googlegroups.com.


Re: How to have \D ignore newline character?

2021-12-13 Thread ThePorgie
Pulling your text and replacing the spaces in the tab areas and then 
Running the following
(?:[- (\.\d]+)?(\d{3})(?:[- )\.]+)?(\d{3})(?:[- )\.]+)?(\d{4})
with a replacement of
\1-\2-\3
yields the following
Name1123-456-7890Single Lifetime
Name2123-456-7890Joint Lifetime
Name3123-456-7890Joint Lifetime
Name4123-456-7890Single
Name5123-456-7890Single
Name6123-456-7890Single
Name7123-456-7890Joint
Name8123-456-7890Joint

Is that what your looking for?

On Monday, December 13, 2021 at 8:41:06 AM UTC-5 Tim A wrote:

> *Try using a negative character class like [^\d\n\r] *
> That will do it! .. and as an extra benefit catches any periods used as a 
> delimiter as well.
>
> Deepening the challenge, the phone numbers are actually in the second of 
> three columns separated by tabs. If I can get the phone numbers stripped I 
> can then impose a uniform format on them. But how do I focus the 
> find/replace on just this second column? I can do this in many small steps, 
> but figure there must be an elegant way to do it in a single step.
>
> Before...
>
> Name11234567890Single Lifetime
> Name2123-4567890Joint Lifetime
> Name3123-456-7890Joint Lifetime
> Name4(123)4567890Single
> Name5(123) 4567890Single
> Name6(123)-4567890Single
> Name7(123)456-7890Joint
> Name8123.456.7890Joint
>
> After...
> Name11234567890SingleLifetime
> Name21234567890JointLifetime
> Name31234567890JointLifetime
> Name41234567890Single
> Name51234567890Single
> Name61234567890Single
> Name71234567890Joint
> Name81234567890Joint
>
>
>
>
>
>

-- 
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/849d58f0-20dd-4219-8fa1-44e697ab3473n%40googlegroups.com.


Re: Cleaning up soft returns in database field content

2021-09-24 Thread ThePorgie
I do this all the time, but doing it in BBedit can mess up where the data 
goes related to the column. I keep the data in Excel and use
=SUBSTITUTE(B2,CHAR(10),"|")
Sub out B2 with your column. I try and replace with something very 
distinctive. I used a pipe in the above.
NOTE: A hard return would be CHAR(13) instead of CHAR(10)
After I run that I copy and paste the values. Lastly Data->Text to Columns 
and use the pipe to delimit.
One final note: Excel will leave the pipe in the delimit option until you 
change it back to use a tab. That can be unexpected the next time you go to 
paste tab delimited copy.
I am also going to attach my Excel ASCII Chart for reference.
On Friday, September 24, 2021 at 3:34:00 PM UTC-4 Christopher Waterman 
wrote:

> Russell
>
> Have you tried the command Text: Zap Gremlins ?
>
> --Chris(topher)?
>
> On Sep 24, 2021, at 5:32 AM, Russell B  wrote:
>
> 
>
>
> I often convert database content moving from one type of database to the 
> other. I always hit an issue with the soft returns in data within fields, 
> where line breaks were entered in the application - they convert into weird 
> characters when exported to text. Is there any way of cleaning these up in 
> BBEdit without interfering with the hard returns that delineate a new 
> record? I usually work in Excel or Filemaker pro.
>
> -- 
> 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/c2a16db0-85f6-4716-a147-46a94fc90d7bn%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/e136605e-7698-4f05-8f62-045b71ead53an%40googlegroups.com.


ASCII Chart.xlsx
Description: MS-Excel 2007 spreadsheet


Re: Use grep replacements in a text factory?

2021-08-19 Thread ThePorgie

Yeah, I'll give you the option in the Text Factory of "Replace All" is a 
bit odd rather than just something like "Find & Replace".
As for the rest. I have a few text factories that don't rely on any saved 
search pattern other than the string used in the text factory itself. The 
only time I don't get the desired result is when I don't/forget to check 
the grep box option in the lower right of the text factory window...that 
little bugger is easy to overlook. I can't really say I've had any problems 
with the manual.
On Thursday, August 19, 2021 at 3:28:51 PM UTC-4 mwra wrote:

> I'm currently re-using grep find/replace via the Find dialog because I 
> can't find a way to save and sequentially apply a number  of find/replace 
> tasks (e.g. 4 or 5 discrete tasks) to a file.
>
> It feels like a Text Factory is the place to do this but it's not to 
> clear. It looks like the rather un-intuitively titled "Replace all" option 
> is the way to go but to to easily re-use find/Replace parings you need to 
> save those as a saved pattern (correct term?)
>
> So, I *think* I've found all the pieces of the task but the documentation 
> could surely be improved as nowhere I can find is this collection of steps 
> hinted at in order to do the predictable task of using Find & Replace in a 
> Text Factory.
>
> I love this app but the manual could do with some review to check items 
> hasn't hidden from search by use of feature terminology that someone new to 
> the feature is unlikely to know.
>
> In another context, I sit on the other end of this task, so I know it 
> seems like a thankless documentation task. For the user of the 
> documentation, the upside is considerable if terminology-obscured features 
> are made more findable.
>
> Thanks
>
> Mark
>

-- 
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/b94beeb6-1cae-4ab3-a821-d3105d28859en%40googlegroups.com.


Re: Window management and virtual desktop question

2021-06-11 Thread ThePorgie
oops "Control" + "Up Arrow". My Bad.

On Friday, June 11, 2021 at 9:15:00 AM UTC-4 ThePorgie wrote:

> Can you not hit the "Command" + "Up Arrow" then drag the window to the 
> space you want. I just tested this in Mojave and it seems to do what you're 
> asking...Except for maybe the all desktops.
>
> On Friday, June 11, 2021 at 9:08:30 AM UTC-4 Patrick Woolsey wrote:
>
>> Alas, you are correct that Spaces just does not provide that sort of 
>> granularity: only the limited options you mention in the Dock, and none at 
>> all to apps _per se_. 
>>
>>
>> Regards, 
>>
>> Patrick Woolsey 
>> == 
>> Bare Bones Software, Inc. <https://www.barebones.com/> 
>>
>>
>>
>> On Jun 11, 2021, at 03:24, Jan Erik Moström  wrote: 
>> > 
>> > I tend to use BBEdit for various things, note taking, writing code, 
>> etc. I also use virtual desktops for doing various things, admin, writing 
>> code, email, etc. 
>> > 
>> > My "problem" is that I want to have the code window(s) only on the code 
>> writing desktop, admin window(s) only on the admin desktop, note taking 
>> window on all desktops, and so on. 
>> > 
>> > Is there some way to config the windows of BBEdit in this way, i.e. 
>> something like this 
>> > 
>> > Window 1 - desktop 1 only 
>> > Window 2 - desktop 2 only 
>> > Window 3 - desktop 2 only 
>> > Window 4 - desktop 1 only 
>> > Window 5 - all desktops 
>> > 
>> > I don't think it's possible but I've missed things before. macOS only 
>> have "this desktop" or "all desktops" 
>> > 
>>
>>

-- 
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/4265242d-919d-4fe4-a641-20aaa81abde0n%40googlegroups.com.


Re: Window management and virtual desktop question

2021-06-11 Thread ThePorgie
Can you not hit the "Command" + "Up Arrow" then drag the window to the 
space you want. I just tested this in Mojave and it seems to do what you're 
asking...Except for maybe the all desktops.

On Friday, June 11, 2021 at 9:08:30 AM UTC-4 Patrick Woolsey wrote:

> Alas, you are correct that Spaces just does not provide that sort of 
> granularity: only the limited options you mention in the Dock, and none at 
> all to apps _per se_. 
>
>
> Regards,
>
> Patrick Woolsey
> ==
> Bare Bones Software, Inc. 
>
>
>
> On Jun 11, 2021, at 03:24, Jan Erik Moström  wrote:
> > 
> > I tend to use BBEdit for various things, note taking, writing code, etc. 
> I also use virtual desktops for doing various things, admin, writing code, 
> email, etc.
> > 
> > My "problem" is that I want to have the code window(s) only on the code 
> writing desktop, admin window(s) only on the admin desktop, note taking 
> window on all desktops, and so on.
> > 
> > Is there some way to config the windows of BBEdit in this way, i.e. 
> something like this
> > 
> > Window 1 - desktop 1 only
> > Window 2 - desktop 2 only
> > Window 3 - desktop 2 only
> > Window 4 - desktop 1 only
> > Window 5 - all desktops
> > 
> > I don't think it's possible but I've missed things before. macOS only 
> have "this desktop" or "all desktops"
> > 
>
>

-- 
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/869cb30f-7af8-4d58-b46b-8474a5875d94n%40googlegroups.com.


Re: Space after line numvers

2020-07-30 Thread ThePorgie
Shouldn't that be "\1\s\s\s\2"


On Thursday, July 30, 2020 at 3:19:32 PM UTC-4, Jim Witte wrote:
>
> find:
> ^([0-9]+[\.]{0,1})(.*)
> replace with:
> \1\s\s\s\1
>
> Would that do what you want?  I'm not sure whether the «\s» in the replace 
> string gets converted to a space character though, or if you actually just 
> need to type spaces there.  \1 is a leading number and optional period, and 
> \2 is the rest of the line.
>
> On Thu, Jul 30, 2020 at 3:09 PM Garrett Taylor  > wrote:
>
>> Howdy,
>>  I would like to add spaces after line numbers. Is it possible?
>>
>> -- 
>> 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 bbe...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/bbedit/49f6174e-5054-49f4-9726-65163418c001o%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/8c78b3a1-248f-4ed9-ad89-522dd172089do%40googlegroups.com.


Re: Extracting parts of names from full names

2020-02-28 Thread ThePorgie
He might be doing a variable data job where the usage in one instance he 
needs the first name only. In another instance he needs the whole 
nameJust off the top of my head Darren.

On Friday, February 28, 2020 at 9:15:35 AM UTC-5, Darren Duncan wrote:
>
> What is the business case for this separation?  For all practical purposes 
> keeping the name as a single string is best.  A better solution to your 
> problem 
> may be changing anything that expects parts to expect a single combined 
> name 
> instead, which would then work for names of any nationality. -- Darren 
> Duncan 
>
> On 2020-02-27 1:43 p.m., 'anotherhoward' via BBEdit Talk wrote: 
> > I have a list of names in this format: 
> > 
> > Luis Gonzalez\gonzalu01 
> > Eddie Perez\perezed02 
> > B.J. Surhoff\surhob.01 
> > Bobby Bonilla\bonilbo01 
> > Keith Lockhart\lockhke01 
> > 
> > I want to extract the last names and separately extract what comes 
> before each 
> > last name 
> > (which could be just the first name or two initials as in "B.J.") so 
> that I can 
> > later organize them this way: 
> > 
> > *First   Last* 
> > LuisGonzalez 
> > Eddie  Eddie 
> > B.J. Surhoff 
> > Bobby Bobby 
> > Keith   Lockhart 
> > 
> > I do not need the data after the slash. 
> > 
> > How can I use GREF (REGEX) to extract the last names and separately the 
> > first/middle values? 
>

-- 
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/2a973054-4fc5-41ff-b224-0aa23c5a664e%40googlegroups.com.


Re: Question about GREP search in XML files with weird CDATA fields

2020-02-24 Thread ThePorgie
I would then include the line above so the string needs "Name"
\n\s+
> Thank you, ThePorgie.
>
> Unfortunately it doesn't work for me.
>
> I should've said that there are many values using this syntax, like this:
> 
> 
> 
> 
> 
> 
> 
> 
>
>
> As you can see, there are two keys, but the very next line says *value* 
> for both of them. That is my main concern.
>
> I want *value1* for each item on the list, but its defining *key* is in 
> the line above with that CDATA formatting.
>
> Any ideas?
>
> El lunes, 24 de febrero de 2020, 11:01:22 (UTC-6), ThePorgie escribió:
>>
>> Put "\1" (no quotes) in the replace field and then Extract with
>> >
>> Will that work for ya?
>>
>>
>>
>> On Monday, February 24, 2020 at 11:44:36 AM UTC-5, Miguel Perez wrote:
>>>
>>> Hi,
>>>
>>> I'm fairly new to RegEx and I need your help.
>>>
>>> I process many XML files in my job. Most of them are formatted 
>>> correctly, that is:
>>> Value
>>> Value
>>>
>>> For those I search for values using:
>>>
>>> .*?
>>> And it works like a charm.
>>>
>>> But then I have this one source that formats its XML files with CDATA 
>>> fields like this:
>>> 
>>> 
>>> 
>>> 
>>> In this example they are trying to say that the value *NAME* is *John 
>>> Appleseed*. Rather than putting it as a key/value pair, they do that 
>>> weird syntax.
>>>
>>> What GREP pattern can I use to extract all the names for this formatting?
>>>
>>> I am open to other solutions, like BASH scripts and Applescript. I'm 
>>> desperate.
>>>
>>> Thank you for your help, friends.
>>>
>>> 
>>>
>>

-- 
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/1cc9de43-63eb-4523-b650-44ee43208d5e%40googlegroups.com.


Re: Question about GREP search in XML files with weird CDATA fields

2020-02-24 Thread ThePorgie
Put "\1" (no quotes) in the replace field and then Extract with

> Hi,
>
> I'm fairly new to RegEx and I need your help.
>
> I process many XML files in my job. Most of them are formatted correctly, 
> that is:
> Value
> Value
>
> For those I search for values using:
>
> .*?
> And it works like a charm.
>
> But then I have this one source that formats its XML files with CDATA 
> fields like this:
> 
> 
> 
> 
> In this example they are trying to say that the value *NAME* is *John 
> Appleseed*. Rather than putting it as a key/value pair, they do that 
> weird syntax.
>
> What GREP pattern can I use to extract all the names for this formatting?
>
> I am open to other solutions, like BASH scripts and Applescript. I'm 
> desperate.
>
> Thank you for your help, friends.
>
> 
>

-- 
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/a24a2625-dd7d-4b3f-8f93-52246883e99d%40googlegroups.com.


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 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, 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 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, 2019, at 12:11 PM, 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: [^>]$
>>
>>
>> -- 
>> 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: <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 bbe...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/bbedit/eb878dec-4eeb-4ce9-bfa9-d8d195293eb4%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/bbedit/eb878dec-4eeb-4ce9-bfa9-d8d195293eb4%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>>
>>

-- 
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: <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/2b73bad4-84dc-4fef-8107-7c06e0f593c7%40googlegroups.com.


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, 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 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, 2019, at 12:11 PM, 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: [^>]$
>
>
> -- 
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/bbedit/eb878dec-4eeb-4ce9-bfa9-d8d195293eb4%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 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/76436ba5-27c1-4455-838d-d41717b1cc1c%40googlegroups.com.


Re: Regex for dealing with commas inside of quotes

2019-10-14 Thread ThePorgie
("[^"]*")

Finding little Snip-its like above is why I like to come look thru these 
grep treads. They completely show me how I'm thinking of the problem all 
wrong. Brilliant!
Thanks!

On Sunday, October 13, 2019 at 7:15:35 AM UTC-4, GP wrote:
>
> You don't need to do it in two steps.  The following pattern captures in 
> groups everything but commas in non-quoted strings:
>
>
> ^(\d{2}\s[A-Z]{3}\s\d{4}),(\d{2}\s[A-Z]{3}\s\d{4}),("[^"]*"),([^,]*),(\d{1,}\.\d{2}),(\d{1,}\.\d{2})$
>
> then do the substitution with the captured groups separated by tab 
> characters.
>
> $1\t$2\t$3\t$4\t$5\t$6
>
> This assumes each entry is formatted like your example.
>
> The ("[^"]*") pattern is what captures the quoted string with embedded 
> commas.
>
> The ([^,]*) pattern handles your example's empty field but can handle a 
> non-empty field in that position as long as it doesn't have an embedded 
> comma.
>
> You may have to do some tweaking on the date and dollar capturing patterns 
> if your statements have some variations in their formats.
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/8e0534e3-1893-4abd-bfad-02adadc8ef0e%40googlegroups.com.


Re: Regex for dealing with commas inside of quotes

2019-10-12 Thread ThePorgie
I'm assuming the Comments can have a varying amount and they might not be 
numbers as well?
If this were a problem I had to tackle I think it would be easier to import 
the data into Excel (or your spreadsheet software of choice) and do a Find 
& Replace on just the one columnI'm coming up empty for a grep solution 
if the data varies like I think it would.

On Friday, October 11, 2019 at 10:08:26 PM UTC-4, Russ Pixels wrote:
>
> I use Text Factory with GREP to process downloaded bank statements, batch 
> converting them from CSV to tab .txt using a simple comma find and replace, 
> but if there are commas in the comments field that screws things up. Can 
> someone supply a regex example that converts only the commas found between 
> the quotes to some other character or a space? In the factory it will run 
> first, then I can convert the commas to tabs. Thanks
>
> Example of issue: 
>
> 28 MAR 2018,27 MAR 2018,"Comments for credited amount Ref: TH 
> 1,2,3,4",,1025.00,2453.85
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/cd8da06d-934d-440e-ab02-6e1e53ed3a48%40googlegroups.com.


Re: Regex replacement item for entire line?

2019-10-03 Thread ThePorgie
I was looking at this again and I think I now understand what you're asking 
forYou don't want to have to write the regex to find the text before 
what you're wanting to put into your delimited result, but you also would 
like it to put the result in front of the whole string. Have I got that 
right? If so, I don't think you can do that with a regex...err, should I 
say "I certainly don't know how to pull that one off".

On Wednesday, October 2, 2019 at 8:01:34 AM UTC-4, Dave R wrote:
>
> I was hoping for an alternative to the & in the replacement strung that 
> means ‘entire source line’ but this works perfectly. 
>
> Thanks! 
>
> Cheers, 
>
> Dave 
>
> > On 2-October-2019, at 7:45 AM, ThePorgie  > wrote: 
> > 
> > Would something like this be what you're looking for? 
> > 
> > .+?/2019/[019]+/([0-9]+)[_.]([0-9]+)-([a-zA-Z]+).* 
> > 
> > This will give you the same result with your replacement string. 
> > 
> > \3 \1, NEN PDF, \1/\2/01, & 
> > 
> > The ".+?" tells the expression to find everything till the rest of the 
> expression that remains matches. If anything is off in the rest of the 
> expression it won't find a result in the string being searched. 
> > 
> > Is that what you're looking for? 
> > 
> > 
> > On Tuesday, October 1, 2019 at 2:05:05 PM UTC-4, Dave R wrote: 
> > Hi folks, 
> > 
> > I have a regex that takes a url apart and makes me a csv of the 
> components: 
> > 
> > Regex: 
> > http://ftp\.newedinburgh\.ca/wp-content/uploads/2019/[019]+/([0-9]+)[_.]([0-9]+)-([a-zA-Z]+).*
> >  
>
> > 
> > and the replacement: 
> > \3 \1, NEN PDF, \1/\2/01, & 
> > 
> > which gives, for example: 
> > April 1976, NEN PDF, 1976/04/01, 
> http://ftp.newedinburgh.ca/wp-content/uploads/2019/09/1976_04-April-New-Edinburgh-News_web.pdf
>  
> > 
> > I am wondering if there is a way to leave the http…2019 out of the regex 
> and, instead of the & (which matches entire regex selection) in the 
> replacement, use something else to represent the entire source line. 
> > 
> > As you can see i’ve found a solution.. but I am always curious to see if 
> there is a simpler way. 
> > 
> > Cheers, 
> > 
> > Dave 
> > 
> > -- 
> > 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: <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 bbe...@googlegroups.com . 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/bbedit/3aea19a9-d72e-4afb-ad16-8cf4e336e9b7%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 to the group.
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/e7b8c06b-5214-4b53-8e8c-e8435bb677b9%40googlegroups.com.


Re: Regex replacement item for entire line?

2019-10-02 Thread ThePorgie
Would something like this be what you're looking for?

.+?/2019/[019]+/([0-9]+)[_.]([0-9]+)-([a-zA-Z]+).* 

This will give you the same result with your replacement string.

\3 \1, NEN PDF, \1/\2/01, & 

The ".+?" tells the expression to find everything till the rest of the 
expression that remains matches. If anything is off in the rest of the 
expression it won't find a result in the string being searched.

Is that what you're looking for?


On Tuesday, October 1, 2019 at 2:05:05 PM UTC-4, Dave R wrote:
>
> Hi folks, 
>
> I have a regex that takes a url apart and makes me a csv of the 
> components: 
>
> Regex: 
> http://ftp\.newedinburgh\.ca/wp-content/uploads/2019/[019]+/([0-9]+)[_.]([0-9]+)-([a-zA-Z]+).*
>  
>
>
> and the replacement: 
> \3 \1, NEN PDF, \1/\2/01, & 
>
> which gives, for example: 
> April 1976, NEN PDF, 1976/04/01, 
> http://ftp.newedinburgh.ca/wp-content/uploads/2019/09/1976_04-April-New-Edinburgh-News_web.pdf
>  
>
> I am wondering if there is a way to leave the http…2019 out of the regex 
> and, instead of the & (which matches entire regex selection) in the 
> replacement, use something else to represent the entire source line. 
>
> As you can see i’ve found a solution.. but I am always curious to see if 
> there is a simpler way. 
>
> Cheers, 
>
> Dave

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/3aea19a9-d72e-4afb-ad16-8cf4e336e9b7%40googlegroups.com.


Re: Grep Search & Insertion

2019-08-30 Thread ThePorgie
Can you post an actual sample of before and after text?

On Friday, August 30, 2019 at 11:48:12 AM UTC-4, Steve Willis wrote:
>
> I have an ePub book (a bunch of XHTML documents) which was generated by 
> InDesign.
>
> In InDesign, I have mapped my dictionary definitions with the terms 
> wrapped to  tags and the definitions wrapped in  tags. That part 
> works great.
>
> The problem is these  and  tags are not wrapped with the requisite 
>  tags, which causes the ePub validator to have whole litters of kittens.
>
> Some of the defs have 1 or more  pairs, others have one  and 
> several  tags, etc.
>
> I want to be able to do a GREP search using BBEdit, finding all the 
>  combos and wrapping the found results with  tags.
>
> 1. Is this even possible?
>
> 2. How do I go about it?
>
> Thanks!
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/1e96f939-3ad0-45cb-a6ad-259404801b38%40googlegroups.com.


Re: Hi all! I have a strange search/replace situation & sometimes looking at GREP makes me cross-eyed!

2019-06-03 Thread ThePorgie
In your sample data would the patten be inconsistent regarding the number 
of commas that need to be replaced? I'm thinking that might be the case 
looking at your sample...Also if you want to replace the commas in the 
bolded copy what is it you want to replace them with?

Not knowing the number of commas I might choose to use Quotes to ID the 
copy with a grep string like

find:
(?<=ArtToCanvas,)(.+)(?=,ArtToCanvas,prints,)
replace:
"\1"

Parts explained **Look ahead and look behind are not found and therefor are 
not captured.
(?<=ArtToCanvas,) Positive look behind
(.+) Captured copy
(?=,ArtToCanvas,prints,) Positive look ahead

This will put Quotes around your copy at which point you would be able to 
replace just the commas between the quotes or import into Excel or most 
other apps as the structure should be correct for dealing with the commas 
in the string.


Hope that helps
-George

On Monday, June 3, 2019 at 9:34:03 AM UTC-4, Aethon wrote:
>
> I have a big file that I had exported from the office as a CSV (forgetting 
> that I had done the first part a while back as tab-separated).
>
> So now I have a list where some of the text columns contains commas and 
> this throws the whole structure/order off.
>
> Here is a sample of the data.
>
>
> home,ATC-Sea-Serpents-by-Gustav-Klimt,ArtToCanvas,*54W x 27H inches : Sea 
> Serpents by Gustav Klimt*,ArtToCanvas,prints,319,,,1,
> https://arttocanvas.com
> home,ATC-Gold-Swirls-by-Lisa-Kowalski,ArtToCanvas,*30W x 40H inches : 
> Gold Swirls by Lisa Kowalski*,ArtToCanvas,prints,269,,,1,
> https://arttocanvas.com
> home,ATC-Blue-Green-and-Brown-by-Mark-Rothko,ArtToCanvas,*26W x 32H 
> inches : Blue, Green, and Brown by Mark Rothko*
> ,ArtToCanvas,prints,219,,,1,https://arttocanvas.com
> home,ATC-La-seperazione-dell-atomo-by-Salvador-Dali,ArtToCanvas,*50W x 
> 26H inches : La seperazione dellatomo by Salvador Dali*
> ,ArtToCanvas,prints,299,,,1,https://arttocanvas.com
>
> Now, what I want is to replace the commas from the centre column (in bold).
>
> I had use a grep search like the following :
>
> ArtToCanvas,(.+),ArtToCanvas,prints 
>
>
> to select the correct information—but I don't know to do a further 
> replacement of the commas when I output the \1.
>
>
> Is this even possible using  Bbedit Grep?
>
> I have version 10.5.3
>
> Thanks,
> George
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/d889a4a4-3de0-467c-af9b-90658d885aea%40googlegroups.com.


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: How to put numbers in front of selected lines?

2019-03-26 Thread ThePorgie
There was a post in this group to do this very thing. I can no longer find 
it to credit the creator. However what he posted was to put this code into 
a BBedit file:


#!/usr/bin/env perl -sw
use utf8;

$/ = "\n";
my $cntr = 0;

while (<>) {
   print ++$cntr.". ";
   chomp;
   print;
   print "\n";
}


Save that as YourFilterName.pl to "~/Library/Application 
Support/BBEdit/Text Filters/YourFilterName.pl

***Not sure if a relaunch is necessary but it couldn't hurt.
Open your list and go the Menu Text->Apply Text Filter and select the 
filter you just created.


Again, I did not write this and deserve no credit and wish I could find the 
thread were I got this from so as to properly credit the person who did 
write it.

-G 



On Tuesday, March 26, 2019 at 8:50:11 AM UTC-4, Vlad Ghitulescu wrote:
>
> Hello!
>
> I have a bunch (64 exactly :-) lines selected (copied from an iTunes 
> playlist and inserted in BBEdit), like this 5 ones
>
> Another One Bites The Dust 3:37
> Bicycle Race 3:04
> Bohemian Rhapsody 5:58
> Breakthru 4:09
> Bring Back That Leroy Brown 2:15
>
> and I would like to prepend a number (beginning with 1) in this format
>
>1. Another One Bites The Dust 3:37 
>2. Bicycle Race 3:04 
>3. Bohemian Rhapsody 5:58 
>4. Breakthru 4:09 
>5. Bring Back That Leroy Brown 2:15 
>
> that is
>
> NUMBER. TRACK-TITLE TRACK-LENGTH
>
> How can I do this?
>
> Thanks!
>
> Regards,
> Vlad
>
> P.S. If I could also replace whatever is before the track length with a 
> space I would be even happier :-D
>

-- 
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: Pattern matching that will exclude items matching another pattern

2019-02-04 Thread ThePorgie
Can you post an example of the text you're searching?

On Monday, February 4, 2019 at 2:22:37 PM UTC-5, Jim Witte wrote:
>
>   That might be confusing.  What I have is a list of words (a conlang 
> file) and I want to select all words that have at least one upper-case 
> letter.  Specifically, I want a pattern that will match:
>
> N\. \\'93[A-Za-z, ]*\\'94
>
> (words enclosed in RTF-style quotes that contain both upper and 
> lower-case, this returns 397 matches)
>
> Then I want to exclude those that match:
>
> N\. \\'93[a-z, ]*\\'94
>
> (words that are only lower-case letters)
>
> I could search for the more inclusive pattern (1) to get set A, and then 
> search the results browser A to extract the ones that also meet the less 
> inclusive pattern (2).  But how do I do the reverse and return only those 
> elements of A that do NOT match pattern 2?
>

-- 
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: Want to strip text out of closed captions to send my father who's partially disabled.

2019-01-19 Thread ThePorgie
I'll give it a go
"<.+?>" to remove the tags
followed by or "|"
followed by "^[\d:,\s>-]+" to remove the sequence and time stamp so replace 
this "<.+?>|^[\d:,\s>-]+" with nothing

Yielded:
the kid has no idea what you mean
because you don't know what you mean but
you mean something like well don't be a
pain in the neck don't be a diva don't
be a don't be narcissistic and something
like that but you actually mean
something really important what you mean

I didn't care for that so I tweaked to leave the sequence number in 
"<.+?>|^\d{2}:[\d:,\s>-]+"

Yielded:
1092
the kid has no idea what you mean

1093
because you don't know what you mean but

1094
you mean something like well don't be a

1095
pain in the neck don't be a diva don't

1096
be a don't be narcissistic and something

1097
like that but you actually mean

1098
something really important what you mean

On Friday, January 18, 2019 at 9:00:44 PM UTC-5, Dj wrote:
>
> Hello, my father is hard of hearing and I'd like to send him some closed 
> caption files so he can read the content like you would a book. Is there an 
> easy way to strip data out of the below example so it's only text, and not 
> timestamps and tags?  I've been failing trying to come up with an 
> expression the last few hours 
>
> Original text is like below and I'm trying to fetch* only the the 
> spoken/text elements so they sit next to each other without gaps*. Is 
> this a multi-part operation, or is it possible with one expression? Thanks!
>
> 1092
> 00:40:25,710 --> 00:40:29,220
> the kid has no idea what you mean
>
> 1093
> 00:40:27,119 --> 00:40:31,019
> because you don't know what you mean color="#CC"> but
>
> 1094
> 00:40:29,219 --> 00:40:33,149
> you mean something like well don't be a
>
> 1095
> 00:40:31,019 --> 00:40:35,369
> pain in the neck don't 
> be a diva don't
>
> 1096
> 00:40:33,150 --> 00:40:36,930
> be a don't be narcissistic and something
>
> 1097
> 00:40:35,369 --> 00:40:39,059
> like that but 
> you actually mean
>
> 1098
> 00:40:36,929 --> 00:40:42,089
> something really important what you mean
>
>

-- 
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 Create Finder Folders from BBEdit Text List

2019-01-15 Thread ThePorgie
I couldn't get this to workSo as an absolute last resort I peeked at 
the manual. ;-). According to the manual "Control-Return" should be used. 
That worked like a charm for me.

On Wednesday, January 9, 2019 at 8:54:54 PM UTC-5, jajls wrote:
>
> On 2019 Jan 9, at 20:27, Bill Kochman > 
> wrote:
>
>
> I have a BBEdit text file with a list of about 300 folder names 
> alphabetically listed in it, one name per line. I need a script which will 
> take those 300 names, and create actual folders with those exact names on 
> my hard drive in a folder on my desktop
>
>
>
> Instead of a script, you could use a Shell Worksheet. File > New > Shell 
> Worksheet
>
> Copy your list into the worksheet, then use   Text > Prefix/Suffix Lines… 
>   to prefix each line with "mkdir ". (Be sure to include the space after 
> mkdir.)
> Now change to the container folder: Type on a new line "cd ", then drag 
> the outer folder and drop it so that the line reads, e.g.,
>
>cd ~/Desktop/theOuterFolder
>
> Select that line and type ⌘-Return.
>
> Now select all the mkdir lines (i.e., your list with the added prefixes), 
> and again type ⌘-Return.
>
> Done.
>

-- 
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: One-liner to replace multiple spaces between words (only words) with one space isn't working

2019-01-14 Thread ThePorgie
The word boundary markers you used didn't work for me. I had to switch to 
"\b". When testing with \b punctuation seemed to mess up my test string. I 
switched to

(?
> On 12 Jan 2019, at 18:32, Dj > wrote: 
> > I'm trying to replace spaces between words so a sentence like this: 
> > 
> > "this line has  really   messed  upspacing” 
>
> It doesn’t look to me like this was actually answered. All the replace 
> multiple space will replace ALL multiple spaces, not simply those between 
> words. 
>
>
> Grep search for: \> +\< 
> Replace with: “ “ # no quotes 
>
> Should do it. No need to involve perl at all. 
>
> (The pattern \> matches the “end of word boundary” and \< matches the 
> “start of word boundary”.) 
>
> -- 
> 'Can't argue with the truth, sir.' 'In my experience, Vimes, you can 
> argue with anything.’ 
>
>

-- 
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: Noob trying to improve on these grep / expressions

2018-12-31 Thread ThePorgie
I ran this expression on your text:
([^\.]+?\?)

with the replace:
\1\n

extracted to:
 —Eskimo proverb What can be added to the happiness of man who is in 
health, out of debt, and has a clear conscience?

 —Adam Smith Do you prefer that you be right, or that you be happy?

 What am I doing right?

 —Tom Walsh Why not seize the pleasure at once?

 How often is happiness destroyed by preparation, foolish preparation?

 Unhappiness Is anyone in all the world safe from unhappiness?

 —Vauvenargues Why is it that so many people are afraid to admit that they 
are happy?

 —Maurice Maeterlinck Who is the happiest of men?

 Da vies Is life so wretched?

 Isn't it rather your hands which are too small, your vision which is 
muddled?

 —Marcus Cato the Elder If you haven't forgiven yourself something, how can 
you forgive others?

 —Mark Twain How shall I love the sin, yet keep the sense, And love the 
offender, yet detest the offence?

 —George Macdonald Who would care to question the ground of forgiveness or 
compassion?

 —Socrates Who Is Really Poor?

 —Japanese proverb Who Is Really Rich?

 —Colette Was it always my nature to take a bad time and block out the good 
times, until any success became an accident and failure seemed the only 
truth?

 Next to what?




On Sunday, December 30, 2018 at 10:00:28 PM UTC-5, Dj wrote:
>
> Hello Chris, 
>
> An example would with the wall of text below, I run this grep expression 
> on it, process lines:   (?:^|\.|\!|\?) ?\K.+?\? to try to extract only 
> sentences with question marks (to new lines and delete every other 
> sentence) and it's not processing right. I only want to see in each line 
> sentences that have question marks. Would it work out better if I segmented 
> the text first so that each sentence gets placed on its own line and do you 
> have an idea of how to do that expression and improve on my original? 
> Thanks for your time and help, I will install BBEdit tonight!
>
>
> Processed text with the original text unprocessed below it.
>
> "oil in your lamp, and peace in your heart. —Eskimo proverb What can be 
> added to the happiness of man who is in health, out of debt, and has a 
> clear conscience? —Adam Smith Do you prefer that you be right, or that you 
> be happy? —A Course In Miracles To do the useful thing, to say the 
> courageous thing
> then the journey is over and it is too late. —Robert R. Updegraff 
> Happiness is a way station between too little and too much. —Channing 
> Pollock Don't Examine Happiness ... Just Enjoy It Enjoy your happiness 
> while you have it, and while you have it do not too closely scrutinize its 
> foundation. —Joseph Farrall My advice to you is not to inquire why or 
> whither, but just enjoy your ice cream while it's on your plate. —Thornton 
> Wilder Most people ask for happiness on condition. Happiness can only be 
> felt if you don't set any condition. —Arthur Rubinstein Suspicion of 
> happiness is in our blood. —E.V. Lucas Ask yourself whether you are happy, 
> and you will cease to be so. —John Stuart Mill Best to live lightly, 
> unthinkingly. —Sophocles The secret of being miserable is to have leisure 
> to bother about whether you are happy or not. —George Bernard Shaw My life 
> has no purpose, no direction, no aim, no meaning, and yet I'm happy. I 
> can't figure it out. What am I doing right? —Charles M. Schulz To describe 
> happiness is to diminish it. —Stendhal Don't Postpone Happiness People who 
> postpone happiness are like children who try chasing rainbows in an effort 
> to find the pot of gold at the rainbow's end Your life will never be 
> fulfilled until you are happy here and now. —Ken Keyes, Jr. Happiness 
> consists of living each day as if it were the first day of your honeymoon 
> and the last day of your vacation. —Anon. Every minute your mouth is turned 
> down you lose sixty seconds of happiness. —Tom Walsh Why not seize the 
> pleasure at once? How often is happiness destroyed by preparation, foolish 
> preparation? —Jane Austen Enjoy yourself. These are the "good old days" 
> you're going to miss in the years ahead. —Anon. Unhappiness Is anyone in 
> all the world safe from unhappiness? —Sophocles Unhappiness is the ultimate 
> form of self-indulgence. —Tom Robbins Sadness is a state of sin. —Andre 
> Gide Unhappiness indicates wrong thinking, just as ill health indicates a 
> bad regimen. —Paul Bourge Unhappiness is best defined as the difference 
> between our talents and our expectations. —Dr. Edward De Bono 28
> is itself poisoned if the measure of suffering has not been fulfilled. 
> —Carl Jung Life begins on the other side of despair. —Jean-Paul Sartre 
> Sadness and gladness succeed each other. —Anon. The Happiness of Not 
> Needing Happiness The greatest happiness you can have is knowing that you 
> do not necessarily require happiness. —William Saroyan Happiness comes 
> fleetingly now and then to those who have learned to do without it, and to 
> them only. —Don 

Re: run javascript from BBEdit

2018-12-13 Thread ThePorgie
I'm sure there may be a more elegant ways to do this buut...

I past the following (between quotes) into a file with html as the extension

"







"

I then write my code in a file called "Script.js". The Script file is saved 
to the same directory/folder as my html file. Then you can run the script 
inside a browser by just saving the script file (not necessary to close) 
and double clicking or refreshing (if already open) the html.



On Tuesday, December 11, 2018 at 9:48:17 AM UTC-5, Gauvins wrote:
>
> Running Python scripts from BBEdit is extremely convenient.
>
> What would be the best way to test code snippets (or an entire script) 
> written in javascript (on OSx)?
>

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

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   

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

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. 

Re: Organizing Docs in a Notebook App and Editing in BBEdit

2018-09-24 Thread ThePorgie
Lewis...I'm stealing that sig.

On Monday, September 24, 2018 at 1:38:02 PM UTC-4, Lewis Butler wrote:
>
> On 23 Sep 2018, at 18:27, Jim Leff > 
> wrote: 
> > I prefer to edit all text in BBEdit, but it's obviously not a notebook 
> app. It would be great to store writings in a dedicated notebook app (e.g. 
> Bear or Agenda) and be able to edit them in BBEdit. It would feel sort of 
> like using BBEdit as a service. Has anyone figured out a clever workflow? 
>
> There used to be an app called, IIRC, QuickEdit. I am not sure if it still 
> around or still works in the modern OS with their much greater security. 
>
> -- 
> If a pig loses its voice, is it disgruntled? 
>
>

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