Re: Formatting Multiple Choice Questions Using Regex

2023-09-13 Thread David G Wagner
I am not the best at regex, but the thought of how to indicate what was correct 
was really all I was offering.  If no one comes forward with a solution, then 
would give it shot for  you.


Wags ;)

WagsWorld
Hebrews 4:15
Ph(primary) : 408-914-1341
Ph(secondary): 408-761-7391

On Sep 13, 2023 at 15:38 -0700, 'anotherhoward' via BBEdit Talk 
, wrote:
> David,
> That sounds like a viable solution. I'm open to that idea. Do I have to do 
> anything to my submission for it to be done the way you suggested?
> Howard
>
> > On Wednesday, September 13, 2023 at 6:08:55 PM UTC-4 David G Wagner wrote:
> > > That is still a lot of work on your end. Why not use a square bracket or 
> > > } as the correct answer then it should be handled in hopefully one pass 
> > > and no one is doing extra work. Just thought…
> > >
> > > Wags ;)
> > >
> > > WagsWorld
> > > Hebrews 4:15
> > > Ph(primary) : 408-914-1341
> > > Ph(secondary): 408-761-7391
> > >
> > > On Sep 13, 2023 at 11:55 -0700, 'anotherhoward' via BBEdit Talk 
> > > , wrote:
> > > >
> > > > Hi Bruce,
> > > >
> > > > I misunderstood what was being asked and appreciate the time you put 
> > > > into your response. I do have a separate answer file for each of my 
> > > > tests. Further, in the forum, l only underlined the correct answers’ 
> > > > text because I thought that was the information I was being asked for. 
> > > > My school’s LMS will grade the exams for me once I supply it with the 
> > > > correct answers, which is easy for me to do.
> > > >
> > > > To make things easier here, as most of my tests contain no more than 20 
> > > > multiple-choice questions, for now, in the reformat, please just use 
> > > > for all the possible answers for each question (there are four, from
> > > > Choice 1 to Choice 4), the word “Incorrect.” Then, once I have the code 
> > > > that will enable me to reformat a specific test’s questions, it should 
> > > > take me only a few minutes in BBEdit to change the correct answer in 
> > > > each question from “Incorrect” to “Correct.”
> > > >
> > > > Please let me know if you have any questions about what I wrote.
> > > >
> > > > Howard
> > > > > On Wednesday, September 13, 2023 at 1:44:00 PM UTC-4 Bruce Van Allen 
> > > > > wrote:
> > > > > > anotherhoward,
> > > > > >
> > > > > > So you’re saying that the input text will have the correct answers 
> > > > > > for each question underlined?
> > > > > >
> > > > > > This seems challenging:
> > > > > >
> > > > > > * A regular expression will not detect text formatting such as 
> > > > > > underlining - in fact in plain text such as what we work with in 
> > > > > > BBEdit, there IS no underlining. Some word processors allow 
> > > > > > searching by text formatting; whether they’re scriptable I don’t 
> > > > > > know.
> > > > > >
> > > > > > * It’s your work :), but it seems tedious to have to manually 
> > > > > > underline or otherwise mark the correct answers for each of up to 
> > > > > > 99 questions, especially if the only reason to do so is to help 
> > > > > > with this transformation. When I’ve built quizzes, the answers are 
> > > > > > in a separate index file that is programmatically accessible for 
> > > > > > grading quizzes; such a thing would also be useful for the kind of 
> > > > > > script that could transform your input into your desired output.
> > > > > >
> > > > > > # Answers_Quiz_016.txt
> > > > > > Q A
> > > > > > 1 a
> > > > > > 2 c
> > > > > > 3 a
> > > > > > 4 d
> > > > > > 5 c
> > > > > > ...
> > > > > >
> > > > > >
> > > > > > * I suppose this is also a matter of what control you have over the 
> > > > > > input - the set of questions and the knowledge/designation of the 
> > > > > > correct answers. Also, how frequently you have to do this.
> > > > > >
> > > > > > More description?
> > > > > >
> > > > > > — Bruce
> > > > > >
> > > 

Re: Formatting Multiple Choice Questions Using Regex

2023-09-13 Thread David G Wagner
That is still a lot of work on your end. Why not use a square bracket or } as 
the correct answer then it should be handled in hopefully one pass and no one 
is doing extra work. Just thought…

Wags ;)

WagsWorld
Hebrews 4:15
Ph(primary) : 408-914-1341
Ph(secondary): 408-761-7391

On Sep 13, 2023 at 11:55 -0700, 'anotherhoward' via BBEdit Talk 
, wrote:
>
> Hi Bruce,
>
> I misunderstood what was being asked and appreciate the time you put into 
> your response. I do have a separate answer file for each of my tests. 
> Further, in the forum, l only underlined the correct answers’ text because I 
> thought that was the information I was being asked for. My school’s LMS will 
> grade the exams for me once I supply it with the correct answers, which is 
> easy for me to do.
>
> To make things easier here, as most of my tests contain no more than 20 
> multiple-choice questions, for now, in the reformat, please just use for all 
> the possible answers for each question (there are four, from
> Choice 1 to Choice 4), the word “Incorrect.” Then, once I have the code that 
> will enable me to reformat a specific test’s questions, it should take me 
> only a few minutes in BBEdit to change the correct answer in each question 
> from “Incorrect” to “Correct.”
>
> Please let me know if you have any questions about what I wrote.
>
> Howard
> > On Wednesday, September 13, 2023 at 1:44:00 PM UTC-4 Bruce Van Allen wrote:
> > > anotherhoward,
> > >
> > > So you’re saying that the input text will have the correct answers for 
> > > each question underlined?
> > >
> > > This seems challenging:
> > >
> > > * A regular expression will not detect text formatting such as 
> > > underlining - in fact in plain text such as what we work with in BBEdit, 
> > > there IS no underlining. Some word processors allow searching by text 
> > > formatting; whether they’re scriptable I don’t know.
> > >
> > > * It’s your work :), but it seems tedious to have to manually underline 
> > > or otherwise mark the correct answers for each of up to 99 questions, 
> > > especially if the only reason to do so is to help with this 
> > > transformation. When I’ve built quizzes, the answers are in a separate 
> > > index file that is programmatically accessible for grading quizzes; such 
> > > a thing would also be useful for the kind of script that could transform 
> > > your input into your desired output.
> > >
> > > # Answers_Quiz_016.txt
> > > Q A
> > > 1 a
> > > 2 c
> > > 3 a
> > > 4 d
> > > 5 c
> > > ...
> > >
> > >
> > > * I suppose this is also a matter of what control you have over the input 
> > > - the set of questions and the knowledge/designation of the correct 
> > > answers. Also, how frequently you have to do this.
> > >
> > > More description?
> > >
> > > — Bruce
> > >
> > > _bruce__van_allen__santa_cruz_ca_
> > >
> > >
> > >
> > >
> > >
> > > > On Sep 13, 2023, at 10:11 AM, 'anotherhoward' via BBEdit Talk 
> > > >  wrote:
> > > >
> > > >
> > > > Bruce,
> > > >
> > > > Please look at my last response, and let me know if that’s provides the 
> > > > needed information.
> > > >
> > > > Thanks,
> > > > Howard
> > > > On Wednesday, September 13, 2023 at 1:06:21 PM UTC-4 Bruce Van Allen 
> > > > wrote:
> > > > Here’s what I think what Kevin is getting at: if you want a generalized 
> > > > method that works for every/any question, not just the three in your 
> > > > example, then that method has to know which answer to designate as 
> > > > correct.
> > > >
> > > > E.g., you’ve said there can be as many as 99 questions; which answer 
> > > > for question 3 would be the correct one? For question 4? etc.
> > > >
> > > > There’s nothing in image 1 (the input) that indicates whether a), b), 
> > > > c), or d) is the correct answer for each question.
> > > >
> > > > — Bruce
> > > >
> > > > _bruce__van_allen__santa_cruz_ca_
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > > On Sep 13, 2023, at 9:55 AM, 'anotherhoward' via BBEdit Talk 
> > > > >  wrote:
> > > > >
> > > > > Kevin,
> > > > > Is this of help? I’ve underlined the correct answers in the input.
> > > > > Howard
> > > > >
> > > > > Here is the input in text format:
> > > > > 1. Why is the "Description" component important when reflecting on 
> > > > > sports?
> > > > > a) It helps you set future goals.
> > > > > b) It provides context and sets the stage for reflection.
> > > > > c) It summarizes the main lessons learned.
> > > > > d) It assesses the positive and negative aspects.
> > > > >
> > > > > 2. Why is the "Evaluation" component important?
> > > > > a) This is choice one.
> > > > > b) This is choice two.
> > > > > c) This is choice three.
> > > > > d) This is choice four.
> > > > >
> > > > > 10. Why is the "Analysis" component important?
> > > > > a) This is choice one.
> > > > > b) This is choice two.
> > > > > c) This is choice three.
> > > > > d) This is choice four.
> > > > >
> > > > > On Wednesday, September 13, 2023 at 12:51:46 PM UTC-4 anotherhoward 
> > > > > wrote:
> > > 

Re: Any Regex Gurus -

2022-07-11 Thread David G Wagner
good[^"]*"[^"]* Will give you:

good for me",yo"
On Jul 11, 2022, 10:13 -0700, Prashant Maheshwari , 
wrote:
> I can extract all text between good and quotes by search good.*"
>
>
> How to modify to extract between two quotes starting from good
> good for me",yo
>
>
>
>
>
> hello how are we doing my brother "good for me",yo","what you say?"
>
>
>
> --
> 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/51853ddb-e1ad-4959-8b3a-0406dd7934cen%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/5aa37792-41cf-413f-a35d-ba5cfc9d7981%40Spark.


Re: Tag conversion to a new format

2022-02-23 Thread David G Wagner
When you state header, this implies that there is more data than what you 
present. Could you provide a small selection of what the data file actually 
looks like? ;)

Wags ;)
WagsWorld
Hebrews 4:15
Ph(primary) : 408-914-1341
Ph(secondary): 408-761-7391
On Feb 22, 2022, 17:04 -0800, lux , wrote:
> Hello everyone,
>
> I got a huge number of posts from an old static blog. Inside the header 
> there's a "tags" line, made this way:
>
> tags: Steve Jobs, Steve Throughton-Smith, T'Bone, Better to Be a Pirate Than 
> Join the Navy, Ben & Jerry, NBA75
>
> The actual number of tags in the line can be any. Comma act as a delimiter 
> and, after that, any character can be used inside a tag, spaces included.
>
> I can choose between two possible destination new formats. The first and 
> preferred one is:
>
> tags:
> - Steve Jobs
> - Steve Throughton-Smith
> - T'Bone
> - (et cetera)
>
> The second format is:
>
> tags: ["Steve Jobs", "Steve Throughton-Smith", "T'Bone", "and so on"]
>
> Can anyone help me getting at least one of the two conversions right?
>
> Many thanks in advance.
>
> lux
> --
> 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/82bdf83e-e068-4d56-a7db-5fc6819c9c9fn%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/e5133710-60c3-4e96-a7ca-6197915bc9f7%40Spark.


Re: Using GREP, need help to extract names and numbers from column

2022-02-10 Thread David G Wagner
I took the data and tried this:

([a-z]\.)([a-z]+)\s+\(([^\)]+)\)(\s*(and){0,1}\s*)

Replace as

\1\2\t\3\n

You stated an extra column needed, so used \t (tab inserted). This did your 
test data in one pass.

Wags ;)
WagsWorld
Hebrews 4:15
Ph(primary) : 408-914-1341
Ph(secondary): 408-761-7391
On Feb 9, 2022, 13:42 -0800, Howard , wrote:
> I have a column with data like this, where each name contains just the first 
> initial, a period, and the last name:
>
> D.Green (59-72) and B.Valentine (12-19)
> D.Green (69-75)
> D.Green (55-58)
> J.Torborg (13-25) and D.Green (46-78)
> J.Torborg (72-90)
> B.Harrelson (74-80) and M.Cubbage (3-4)
> D.Johnson (20-22) and B.Harrelson (71-49)
> D.Johnson (87-75)
>
> Some rows have one name and a pair of numbers in parentheses separated by a 
> dash, and some rows have two names, each followed by a pair of numbers in 
> parentheses separated by a dash.
>
> In each row, I can extract the first name (both the initial and the last 
> name) and put a space between them using `^([A-Z]\.)([A-z,a-z]+)` and `\1 \2`
> with all results appearing in their own column.
>
> What I need help to do is this:
> 1. Using GREP, I need to extract the numbers in parentheses after the first 
> names and put them in their own column without parentheses.
> 59-72
> 69-75
> 55-58 etc.
>
> 2. In those rows with a second name, using GREP I need to extract the second 
> names and put them in their own column, so they look like this:
> B. Valentine
> D. Green
> M. Cubbage
> B. Harrelson
>
> I also need to extract the numbers in parentheses after the second names, but 
> believe that I can figure out how to do that from the answer to #1 above.
>
> Thanks,
> 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/e3034738-5b73-4c3b-a016-7a88615d5f54n%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/a5742e3c-daa6-431e-a56f-52f7188b38c2%40Spark.


Re: [ OFFLIST ] Need to increment a counter for chapter count

2022-01-07 Thread David G Wagner
Correct. That does work. But what if it could be either start or Start. In what 
you have, what would you have to change for either of those cases?

Wags ;)
WagsWorld
Hebrews 4:15
Ph(primary) : 408-914-1341
Ph(secondary): 408-761-7391
On Jan 7, 2022, 15:39 -0800, bbedit@googlegroups.com, wrote:
>
> #!/usr/bin/env perl
>
> my $incr = 1;
> local $/ = "#Start#\n";
>
> while (<>) {
> s/^1/$incr++/es;
> print;
> }

-- 
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/c6413eac-2d31-4c13-88a5-bc500fdc80a1%40Spark.


Re: [ OFFLIST ] Need to increment a counter for chapter count

2022-01-07 Thread David G Wagner
Chris S,
Here is the data that I am working with. Used red text to delineate the data 
being processed. To me the testing is correct as that is pretty much how I 
would do it with Perl, but nothing was updated… ;)

All data below this line
#start#
1 In the beginning, God created the heavens and the earth. 2 The earth was 
without form and void, and darkness was over the face of the deep. And the 
Spirit of God was hovering over the face of the waters.
3 And God said, Let there be light, and there was light. 4 And God saw that the 
light was good. And God separated the light from the darkness. 5 God called the 
light Day, and the darkness he called Night. And there was evening and there 
was morning, the first day.
6 And God said, Let there be an expanse in the midst of the waters, and let it 
separate the waters from the waters. 7 And God made the expanse and separated 
the waters that were under the expanse from the waters that were above the 
expanse. And it was so. 8 And God called the expanse Heaven. And there was 
evening and there was morning, the second day.
9 And God said, Let the waters under the heavens be gathered together into one 
place, and let the dry land appear. And it was so. 10 God called the dry land 
Earth, and the waters that were gathered together he called Seas. And God saw 
that it was good.
11 And God said, Let the earth sprout vegetation, plants yielding seed, and 
fruit trees bearing fruit in which is their seed, each according to its kind, 
on the earth. And it was so. 12 The earth brought forth vegetation, plants 
yielding seed according to their own kinds, and trees bearing fruit in which is 
their seed, each according to its kind. And God saw that it was good. 13 And 
there was evening and there was morning, the third day.
14 And God said, Let there be lights in the expanse of the heavens to separate 
the day from the night. And let them be for signs and for seasons, and for days 
and years, 15 and let them be lights in the expanse of the heavens to give 
light upon the earth. And it was so. 16 And God made the two great lights the 
greater light to rule the day and the lesser light to rule the night and the 
stars. 17 And God set them in the expanse of the heavens to give light on the 
earth, 18 to rule over the day and over the night, and to separate the light 
from the darkness. And God saw that it was good. 19 And there was evening and 
there was morning, the fourth day.
20 And God said, Let the waters swarm with swarms of living creatures, and let 
birds fly above the earth across the expanse of the heavens. 21 So God created 
the great sea creatures and every living creature that moves, with which the 
waters swarm, according to their kinds, and every winged bird according to its 
kind. And God saw that it was good. 22 And God blessed them, saying, Be 
fruitful and multiply and fill the waters in the seas, and let birds multiply 
on the earth. 23 And there was evening and there was morning, the fifth day.
24 And God said, Let the earth bring forth living creatures according to their 
kinds livestock and creeping things and beasts of the earth according to their 
kinds. And it was so. 25 And God made the beasts of the earth according to 
their kinds and the livestock according to their kinds, and everything that 
creeps on the ground according to its kind. And God saw that it was good.
26 Then God said, Let us make man in our image, after our likeness. And let 
them have dominion over the fish of the sea and over the birds of the heavens 
and over the livestock and over all the earth and over every creeping thing 
that creeps on the earth.
27 So God created man in his own image,
in the image of God he created him;
male and female he created them.
28 And God blessed them. And God said to them, Be fruitful and multiply and 
fill the earth and subdue it, and have dominion over the fish of the sea and 
over the birds of the heavens and over every living thing that moves on the 
earth. 29 And God said, Behold, I have given you every plant yielding seed that 
is on the face of all the earth, and every tree with seed in its fruit. You 
shall have them for food. 30 And to every beast of the earth and to every bird 
of the heavens and to everything that creeps on the earth, everything that has 
the breath of life, I have given every green plant for food. And it was so. 31 
And God saw everything that he had made, and behold, it was very good. And 
there was evening and there was morning, the sixth day.
#EndOfGen#
#Start#
1 Thus the heavens and the earth were finished, and all the host of them. 2 And 
on the seventh day God finished his work that he had done, and he rested on the 
seventh day from all his work that he had done. 3 So God blessed the seventh 
day and made it holy, because on it God rested from all his work that he had 
done in creation.
The Creation of Man and Woman
4 These are the generations
of the heavens and the earth when they were created,
in the day that 

Re: [ OFFLIST ] Re: Need to increment a counter for chapter count

2022-01-06 Thread David G Wagner
Chris S, I tried your script, but nothing appears to happen. No changes.

I made mods to your code. I was not as clear as I should have been on 
explanation desired results.

What I am working on is 50 chapters which are of the format:
#start#
1 xx
2 xxx
….
n xxx
#endofGen#
What I am trying to do is after I find a start, then the next line should be a 
1 and text. I want to change that 1 to whatever the current chapter number it 
should be. All the chapters ar in order. Example for 20 chapter, the output 
would look like:

#start#
20 xx
2 xxx
….
n xxx
#endofGen#

That line starting with a 1 and following a start is the only change desired.

I am on MacOS 10.15.7 and the very latest BBEdit 14.0.5. The Perl I  am 
executing is 5.28.2.

I get no errors when I run the the filter.

Here is what I have as a script after my minor changes:

my $cntr = 0;
my $ChgSw = 0;
while (<>) {
    if ( /^#Start#/i ) {
        $cntr++;
        $ChgSw = 1;
     }
    if ( $ChgSw ) {
        if ( /^1\h/ ) {
            s!^1!$cntr!;
         }
        $ChgSw = 0;
     }
    print;
}

Sorry for delay in getting back to you. I truly appreciate the insight from 
what I see in the scripts and the way they work with BBEdit.

Wags ;)
WagsWorld
Hebrews 4:15
Ph(primary) : 408-914-1341
Ph(secondary): 408-761-7391
On Jan 6, 2022, 04:56 -0800, Christopher Stone , 
wrote:
> Hey Chris,
>
> This fails on my Mojave system with the stock `awk`.
>
>
> #Start#Start#Start#
> 2 In the beginning, God created the heavens and
> Xxccx
> #Start#EndOfGen#Start#
> #Start#Start#Start#
> 6 Thus the heavens and the earth were finished,
> Xxxx
> #Start#EndOfGen#Start#
> #Start#Start#Start#
> 10 Now the serpent was more crafty than any other beast of the field that the 
> LORD God had made.
> Xxx
> #Start#EndOfGen#Start#
>
>
> It works if I use the current version of `gawk`.
>
> It looks like David has an older version of macOS as well.
>
> --
> Take Care,
> Chris
>
>
> > On Jan 05, 2022, at 21:52, Christopher Waterman  
> > wrote:
> >
> > Sorry David,
> >
> > I did make a mistake but the output you're getting still confuses me.
> > All my chapter numbers were off by one, but that was it.
> >
> > Anyway here is the fixed script. ( I think 爛)
> >
> > I provided an example of my input and output, also a screenshot.
> > Be sure to copy the script exactly.
> >
> > #!/usr/bin/env awk -f
> >
> > BEGIN {
> > RS = "#Start#"
> > ORS = ""
> > FS = "\n"
> > OFS = "\n"
> > }
> >
> > {
> > sub( /[0-9]+/, NR-1 , $2 )
> > }
> >
> > NR != 1 {
> > print "#Start#" $0
> > }
> >
> > Input:
> > #Start#
> > 1 In the beginning, God created the heavens and
> > Xxccx
> > #EndOfGen#
> > #Start#
> > 1 Thus the heavens and the earth were finished,
> > Xxxx
> > #EndOfGen#
> > #Start#
> > 1 Now the serpent was more crafty than any other beast of the field that 
> > the LORD God had made.
> > Xxx
> > #EndOfGen#
>
> --
> 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/18DA528B-9E6C-4B84-BAD4-1462489AB0ED%40gmail.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/f7c8ebd0-5f52-490b-95df-7500b9b6f958%40Spark.


Re: Need to increment a counter for chapter count

2022-01-06 Thread David G Wagner
Well, not sure what is going on. Here is the three chapters of data after I run 
the corrected Text Filter. Before I executed your script, I executed Mormdliz 
line endings to just make sure though I am only working on an Mac or related 
Apple items.

I was going to send you the actual three chapters, but it will go to the whole 
group which I think is too much data.

If you want to send email to wagsworl...@yahoo.com and I will send you two txt 
files with input and the output I get from executing the script.  If not, that 
is done and will it work it out differently.

Again thanks for your time and effort to help. It is much appreciated...

Wags ;)
WagsWorld
Hebrews 4:15
Ph(primary) : 408-914-1341
Ph(secondary): 408-761-7391
On Jan 5, 2022, 19:52 -0800, Christopher Waterman , 
wrote:
> Sorry David,
>
> I did make a mistake but the output you're getting still confuses me.
> All my chapter numbers were off by one, but that was it.
>
> Anyway here is the fixed script. ( I think 爛)
>
> I provided an example of my input and output, also a screenshot.
> Be sure to copy the script exactly.
>
> #!/usr/bin/env awk -f
>
> BEGIN {
>   RS = "#Start#"
>   ORS = ""
>   FS = "\n"
>   OFS = "\n"
> }
>
> {
>   sub( /[0-9]+/, NR-1 , $2 )
> }
>
> NR != 1 {
>   print "#Start#" $0
> }
>
> Input:
> #Start#
> 1 In the beginning, God created the heavens and
> Xxccx
> #EndOfGen#
> #Start#
> 1 Thus the heavens and the earth were finished,
> Xxxx
> #EndOfGen#
> #Start#
> 1 Now the serpent was more crafty than any other beast of the field that the 
> LORD God had made.
> Xxx
> #EndOfGen#
>
> Output:
> #Start#
> 1 In the beginning, God created the heavens and
> Xxccx
> #EndOfGen#
> #Start#
> 2 Thus the heavens and the earth were finished,
> Xxxx
> #EndOfGen#
> #Start#
> 3 Now the serpent was more crafty than any other beast of the field that the 
> LORD God had made.
> Xxx
> #EndOfGen#
>
> Here is a screenshot of the results.
> 
>
>
> — Chris(topher)?
>
>
>
> > On Jan 5, 2022, at 6:34 PM, David G Wagner  wrote:
> >
> > Thank, Chris but did not do as desired.
> >
> > Here is the output received(cutdown from my extended data test):
> >
> > #Start##Start#start#Start#
> > 3 In the beginning, God created the heavens and the
> > #Start#EndOfGen#Start#
> > #Start#Start#Start#
> > 7 Thus the heavens and the earth were finished, and #Start#EndOfGen#Start#
> > #Start#Start#Start#
> > 11 Now the serpent was more crafty than any other #Start#EndOfGen#Start#
> >
> > Desired out:
> >
> > #Start#
> > 1 In the beginning, God created the heavens and the
> > #EndOfGen#
> > #Start#
> > 2 Thus the heavens and the earth were finished, and #EndOfGen#
> > #Start#
> > 3 Now the serpent was more crafty than any other
> > #EndOfGen#
> >
> > What each start and end is a chapter. In the data. You Have the start and 
> > then 1. What I want to do is replace the 1 with the current chapter number. 
> > First hit is Chapter 1. The fifth would be Chapter 5, etc.
> >
> > Thoughts???
> >
> > Wags ;)
> > WagsWorld
> > Hebrews 4:15
> > Ph(primary) : 408-914-1341
> > Ph(secondary): 408-761-7391
> > On Jan 5, 2022, 18:01 -0800, bbedit@googlegroups.com, wrote:
> > >
> > > #!/usr/bin/env awk -f
> > >
> > > BEGIN {
> > > RS = "#Start#"
> > > ORS = ""
> > > FS = "\n"
> > > OFS = "\n"
> > > }
> > >
> > > {
> > > sub( /[0-9]+/, NR , $2 )
> > > print "#Start#" $0
> > > }
> >
> > --
> > 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/9934c9ba-53d0-4701-8e4f-c29fb2d94941%40Spark.
>
> --
> 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 postin

Re: Need to increment a counter for chapter count

2022-01-05 Thread David G Wagner
Thank, Chris but did not do as desired.

Here is the output received(cutdown from my extended data test):

#Start##Start#start#Start#
3 In the beginning, God created the heavens and the
#Start#EndOfGen#Start#
#Start#Start#Start#
7 Thus the heavens and the earth were finished, and #Start#EndOfGen#Start#
#Start#Start#Start#
11 Now the serpent was more crafty than any other #Start#EndOfGen#Start#

Desired out:

#Start#
1 In the beginning, God created the heavens and the
#EndOfGen#
#Start#
2 Thus the heavens and the earth were finished, and #EndOfGen#
#Start#
3 Now the serpent was more crafty than any other
#EndOfGen#

What each start and end is a chapter. In the data. You Have the start and then 
1. What I want to do is replace the 1 with the current chapter number. First 
hit is Chapter 1. The fifth would be Chapter 5, etc.

Thoughts???

Wags ;)
WagsWorld
Hebrews 4:15
Ph(primary) : 408-914-1341
Ph(secondary): 408-761-7391
On Jan 5, 2022, 18:01 -0800, bbedit@googlegroups.com, wrote:
>
> #!/usr/bin/env awk -f
>
> BEGIN {
> RS = "#Start#"
> ORS = ""
> FS = "\n"
> OFS = "\n"
> }
>
> {
> sub( /[0-9]+/, NR , $2 )
> print "#Start#" $0
> }

-- 
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/9934c9ba-53d0-4701-8e4f-c29fb2d94941%40Spark.


Need to increment a counter for chapter count

2022-01-05 Thread David G Wagner
I have the following data:

#Start#
1 In the beginning, God created the heavens and
Xxccx
#EndOfGen#
#Start#
1 Thus the heavens and the earth were finished,
Xxxx
#EndOfGen#
#Start#
1 Now the serpent was more crafty than any other beast of the field that the 
LORD God had made.
Xxx
#EndOfGen#
….

In this case, I have 50 sets of start and end groups. The output I want is:

#Start#
1 In the beginning, God created the heavens and
Xxccx
#EndOfGen#
#Start#
2 Thus the heavens and the earth were finished,
Xxxx
#EndOfGen#
#Start#
3 Now the serpent was more crafty than any other beast of the field that the 
LORD God had made.
Xxx
#EndOfGen#
…

What I am doing is placing the chapter count as the first number after the 
start.

I have data in one file and in one window. I could write a Perl script, but was 
wanting to handle within BBEdit via filter or ?

I see only one variable, that being the chapter count.

Thoughts would be appreciated.

Thanks…

Wags ;)
WagsWorld
Hebrews 4:15
Ph(primary) : 408-914-1341
Ph(secondary): 408-761-7391

-- 
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/5ab44bf1-95cd-4ca8-aa4c-d798f9d12deb%40Spark.


Re: Need easy way to make first letter of each line upper case

2021-10-29 Thread David G Wagner
You replace the ^ + with ^\s+ which would handle both spaces and tabs if there… 
;)

Wags ;)
WagsWorld
Hebrews 4:15
Ph(primary) : 408-914-1341
Ph(secondary): 408-761-7391
On Oct 29, 2021, 04:03 -0700, Satomi Yoneki , wrote:
>
> > I meant the number of the line, as in the numbers in the left hand column.
> Those numbers are Line Numbers.
> > The lines typically look like this: "so, it was" Or, " so, it
> > was"  Which is something else I'd like to have a Grep for:
> > removing spaces at the beginning of all lines.
> Please try this.
> Find: "^ +", which will search for one or more space characters at the
> beginning of each line.
> Replace: "" (empty)
>
> If this does not delete spaces, maybe the text contains other invisible
> characters.
> You can select them and see what they are with Window > Palettes >
> Character Inspecter.
>
>
> --
> 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/95570f34-7dbe-f346-2bdf-86ed65dec6b8%40gmail.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/bcc1c2a0-c660-4954-8047-0896d43f5a4c%40Spark.


Re: Is this the best workflow to merge?

2021-08-25 Thread David G Wagner
Oh, there is, but we would need someone with Applescript knowledge which could 
take a folder of files, have a new folder made to hold all the concatenated 
files until you are sure they are correct. They should be able to find all 
files of similar naming convention, concat the files, provide a simple report 
of the new files, write them to the new folder(could write to fame folder, but 
to me, would be easier review.

So, yes, it can be done with a script...

Wags ;)
WagsWorld
Hebrews 4:15
Ph(primary) : 408-914-1341
Ph(secondary): 408-761-7391
On Aug 25, 2021, 15:15 -0700, David J , wrote:
> Hi Harvey and Jean,
>
> Jean, I tried your method and it's really great that I can insert files like 
> that. I had no idea. What (it seems) I then have to do is go back to Finder 
> and get the file name so I can save the merged files with the file name as 
> the title. Where it starts to literally hurt is I have to do this thousands 
> of times because the one folder has thousands of files that need to be 
> merged, all with slightly different file names like:
>
> Highlights for Zen and the Art of Motorcycle Maintenance by Robert M. Pirsig 
> 3.md
> Highlights for Zen and the Art of Motorcycle Maintenance by Robert M. Pirsig 
> 4.md
> Highlights for Zen and the Art of Motorcycle Maintenance by Robert M. Pirsig 
> 5.md
> Highlights for Zen and the Art of Motorcycle Maintenance by Robert M. Pirsig 
> 6.md
> Highlights for Zen and the Art of Motorcycle Maintenance by Robert M. 
> Pirsig.md  <- hoping for end result of 3-6 merged like so into one 
> file with that title. Same for all files in the same directory with similar 
> names like below:
>
> Highlights for Zero History by William Gibson(1).md
> Highlights for Zero History by William Gibson(2).md
> Highlights for Zero History by William Gibson.md
>
> Highlights for The Hitchhiker's Guide to the Galaxy by Douglas Adams(1).md
> Highlights for The Hitchhiker's Guide to the Galaxy by Douglas Adams(2).md
> Highlights for The Hitchhiker's Guide to the Galaxy by Douglas Adams.md
>
> Journal John's bday (1)
> Journal John's bday
>
> Random thought jan 7 (1)
> Random thought jan 7 (2)
> Random thought jan 7 (3)
> Random thought jan 7
>
> The shell script is a little out of my knowledge, I'll do a little more 
> reading. Was advised to also try:
>
> "You can do this by putting the files in a folder and using cat *.md 
> >>../somefilename.md should concatenate them to a new file one level up."
>
> But seeing how the files are varied and slightly different like the above 
> directory example. Using  *.md >>../somefilename.md   would merge 
> everything into one file name? Was hoping there's some way to merge 
> everything in the folder with similar files names into there similar file 
> names.
>
> I'm trying to get my elderly father much of my thoughts, highlights, journals 
> while he's still around so I do appreciate the help 
>
> > On Wednesday, August 25, 2021 at 1:21:16 PM UTC-7 jj wrote:
> > > Hi David,
> > >
> > > 1. Create a new empty document.
> > > 2. Then choose Menu Edit > Insert > File Contents ...
> > > 3. In the presented dialog click the bottom right "Options" button and 
> > > check which options you want.
> > >     [ ] Include separators
> > >     [√] Ensure line break after each inserted file  (Highly recommended)
> > > 4. Select the files you want to insert.
> > > 5. Click insert and you are done.
> > > You can repeat the operation if needed.
> > > HTH
> > >
> > > Jean Jourdain
> > > > On Wednesday, August 25, 2021 at 9:40:06 PM UTC+2 Harvey Pikelberger 
> > > > wrote:
> > > > > What about a simple shell script?
> > > > >
> > > > > cat file1 file2 file3 > newfile
> > > > >
> > > > > > On Aug 25, 2021, at 12:17, David J  wrote:
> > > > > >
> > > > > > Hello,
> > > > > >
> > > > > >
> > > > > > I have thousands of Markdown files in the same folder  I'm trying 
> > > > > > to merge so my elderly father can read them. File names are like 
> > > > > > samefilename (1), samefilename (2), samefilename (3).
> > > > > > I"ve been dragging and dropping all the samefilename.md (1, 2, 3, 
> > > > > > etc) into one bbedit tab. Then typing in samefilename.txt and 
> > > > > > saving it as one text. It's still quite time-consuming with 
> > > > > > thousands of files that are split up into threes, fours, etc in one 
> > > > > > folder.
> > > > > > Is there a better way of doing this? Possible to select: 
> > > > > > samefilename (1), samefilename (2), samefilename (3)  in Finder, 
> > > > > > merge and save as Samefilename.txt back to Finder? Seems like 
> > > > > > something terminal/bbedit could do?
> > > > > >
> > > > > > With respect, David
> > > > > >
> > > > > >
> > > > > > --
> > > > > > 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: 
> > 

Re: How to grep a list of hyperlink to capitalise the words

2021-04-18 Thread David G Wagner
Not pretty, but if the input you are looking at is consistent then I got this 
to work. Unsure on the 21 thru 29 if that was the format you wanted, since you 
did not show that portion... ;)

Find:
 
^(\d{1,2}\.\s{1,})TEXT\s{1,}([a-zA-Z])([a-zA-Z-]+)(\s{0,})(\<\/a\>)

Replace:
\1Text \u\2\L\3\E\4\5

Input:
1. TEXT ONE
2. TEXT TWO
3. TEXT THREE
4. TEXT FOUR
5. TEXT FIVE
6. TEXT SIX
7. TEXT SEVEN
8. TEXT EIGHT
9. TEXT NINE
10. TEXT TEN
11. TEXT ELEVEN
12. TEXT TWELVE
13. TEXT THIRTEEN
14. TEXT FOURTEEN
15. TEXT FIFTEEN
16. TEXT SIXTEEN
17. TEXT SEVENTEEN
18. TEXT EIGHTTEEN
19. TEXT NINETEEN
20. TEXT TWENTY
21. TEXT TWENTY-ONE
22. TEXT TWENTY-TWO
23. TEXT TWENTY-THREE
24. TEXT TWENTY-FOUR
25. TEXT TWENTY-FIVE
26. TEXT TWENTY-SIX
27. TEXT TWENTY-SEVEN
28. TEXT TWENTY-EIGHT
29. TEXT TWENTY-NINE
30. TEXT THIRTY

Output:
1. Text One
2. Text Two
3. Text Three
4. Text Four
5. Text Five
6. Text Six
7. Text Seven
8. Text Eight
9. Text Nine
10. Text Ten
11. Text Eleven
12. Text Twelve
13. Text Thirteen
14. Text Fourteen
15. Text Fifteen
16. Text Sixteen
17. Text Seventeen
18. Text Eightteen
19. Text Nineteen
20. Text Twenty
21. Text Twenty-one
22. Text Twenty-two
23. Text Twenty-three
24. Text Twenty-four
25. Text Twenty-five
26. Text Twenty-six
27. Text Twenty-seven
28. Text Twenty-eight
29. Text Twenty-nine
30. Text Thirty

Wags ;)
WagsWorld
Hebrews 4:15
Ph(primary) : 408-914-1341
Ph(secondary): 408-761-7391
On Apr 18, 2021, 09:44 -0700, Francisco Hirsch , wrote:
> I have a text like this”
> > quote_type
> > 1. TEXT ONE
> > 2. TEXT TWO
> > ….
> > 30. TEXT THIRTY
>
> And I want to to convert it to:
> > quote_type
> > 1. Text One
> > 2. Text Two
> > ….
> > 30. Text Thirty
> >
> Is it possible to do a grep magic or Text Factory?
> Saludos,
> Francisco
> --
> Lic. Francisco A. Hirsch
> https://www.fiscaldemesa.com.ar
> Twitter: https://twitter.com/fiscaldemesa
>
>
>
>
>
>
>
> --
> This is the BBEdit Talk public discussion group. If you have a feature 
> request or need technical support, please email "supp...@barebones.com" 
> rather than posting 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/2926515F-7DF5-4DB1-A013-FD842FE3454A%40gmail.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/92d02f5c-b8c4-45bc-9a6c-33b93b848143%40Spark.


Re: grep pattern to find special combinations of fields in a large csv file

2020-07-29 Thread David G Wagner
You will have in history and you can use the script editor to record your 
actions, save that output and execute. Personally a Perl individual, but you 
should be able to follow the shooting... A thought...

Wags ;)
WagsWorld
Hebrews 4:15
Ph(primary) : 408-914-1341
Ph(secondary): 408-761-7391
On Jul 29, 2020, 10:41 -0700, Lewis Downey , wrote:
> Neil, face,
>
> No doubt you are right. By now i should be perfectly comfortable building and 
> querying MySQL tables. However so far I have punted on learning SQL. Same for 
> Perl. It could still happen, maybe...
>
> Thanks for the replies.
>
> (still curious if grep could find the correct results.)
>
> --
> 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/1c35204d-6125-4e53-bd0e-c6dfcf5e0d75o%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/43b52afa-e664-4bb8-a69a-93673a88d796%40Spark.


How to actually set an expert preference?

2020-06-15 Thread David G Wagner
I looked at the doc and did some searches on the net and either I used the 
wrong wording or did not view the right outputs, but I never did see how one is 
to set a particular expert preference or see what expert preferences are set.

I tried a shell worksheet and executed ’env’ and got the output back. But never 
understood how to set a preference or see what others are set.

Any examples or if in doc, point me to it...

Thanks... ;)

Wags ;)
WagsWorld
Hebrews 4:15
Ph(primary) : 408-914-1341
Ph(secondary): 408-761-7391

-- 
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/278792e9-9922-4b15-ac3f-ac6b0ee949a1%40Spark.


Re: Including "Sr." or "Jr." in name where applicable

2020-02-29 Thread David G Wagner
It works but is not quite right. That period there should really be expanded to:
\.{0,1}

So it should read now as:
> > ^([a-z,A-Z,\.]+) ([a-z,A-Z]+(\s(jr|sr)\.{0,1}){0,1})
> >
> > Where my new part says:
> >
> > A space followed by either Jr or Sr and there will be a period and not.
> >
> > The {} has a low and high:
> >
> > {1,2} what preceded the { can occur either one or two times
> >
> > {1,} says what preceded the { can occur 1 or more times
> >
> > Probably a number of other ways, but this should now work with jr or st 
> > with it without a period following...
> >
> > Sorry about the incorrect first pass... ;)

Wags ;)
WagsWorld
Hebrews 4:15
Ph(primary) : 408-914-1341
Ph(secondary): 408-761-7391
On Feb 29, 2020, 12:33 -0800, 'anotherhoward' via BBEdit Talk 
, wrote:
> Thanks. How does this part of the expression work?—  (\s(jr|sr).){0,1})
>
>
> On Saturday, February 29, 2020 at 2:42:43 PM UTC-5, David G Wagner wrote:
> > You could add:
> > (\s(jr|sr).){0,1} within the last set of parens so would look like:
> >
> > ^([a-z,A-Z,\.]+) ([a-z,A-Z]+(\s(jr|sr).){0,1})
> >
> > This would handle those who do not put a period after the Jr or Sr also.
> >
> >
> > Wags ;)
> > WagsWorld
> > Hebrews 4:15
> > Ph(primary) : 408-914-1341
> > Ph(secondary): 408-761-7391
> > On Feb 29, 2020, 05:40 -0800, 'anotherhoward' via BBEdit Talk , wrote:
> > > In a previous post, "Extracting parts of names from full names," I asked 
> > > about how to extract the first and last names from a string.
> > >
> > > Here is an input sample:
> > >
> > > Felix Jose\josefe01
> > > Tony Clark\clarkto02
> > > Matt Williams\willima04
> > > John McDonald\mcdonjo03
> > > Mark Grace\gracema01
> > > Steve Finley\finlest01
> > > B.J. Surhoff\surhob.01
> > > J.T. Snow\snowj.01
> > >
> > > When I re-examined the full dataset, I noticed two cases not included 
> > > previously.
> > > Eric Young Sr.\younger0
> > > Ken Griffey Jr.\griffke02
> > >
> > > Based on the helpful feedback I got in my previous post, now what I need 
> > > is a pattern that would handle not only all the original input items plus 
> > > the two new cases. Further, what I would like extracted is everything up 
> > > to but not including the backslash.
> > >
> > > This attempt (of mine) finds everything in the original dataset, but I 
> > > was unable to expand it to include either the "Sr." or "Jr.":
> > > ^([a-z,A-Z,\.]+) ([a-z,A-Z]+)
> > >
> > > 1. Is there a way my attempt can be expanded so it includes "Sr." or 
> > > "Jr." when a name has either of them?
> > > 2. What pattern would you write to accomplish the task?
> > > --
> > > 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/8a68d4b5-6d57-4c4c-8cd0-1ed5c30f85d5%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: 
> <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/a8720563-fcc5-4e04-a7d8-f1f2111bde4f%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: <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/6915075b-a2f8-4367-8ff8-f027d7758fee%40Spark.


Re: Including "Sr." or "Jr." in name where applicable

2020-02-29 Thread David G Wagner
You could add:
(\s(jr|sr).){0,1} within the last set of parens so would look like:

^([a-z,A-Z,\.]+) ([a-z,A-Z]+(\s(jr|sr).){0,1})

This would handle those who do not put a period after the Jr or Sr also.


Wags ;)
WagsWorld
Hebrews 4:15
Ph(primary) : 408-914-1341
Ph(secondary): 408-761-7391
On Feb 29, 2020, 05:40 -0800, 'anotherhoward' via BBEdit Talk , wrote:
> In a previous post, "Extracting parts of names from full names," I asked 
> about how to extract the first and last names from a string.
>
> Here is an input sample:
>
> Felix Jose\josefe01
> Tony Clark\clarkto02
> Matt Williams\willima04
> John McDonald\mcdonjo03
> Mark Grace\gracema01
> Steve Finley\finlest01
> B.J. Surhoff\surhob.01
> J.T. Snow\snowj.01
>
> When I re-examined the full dataset, I noticed two cases not included 
> previously.
> Eric Young Sr.\younger0
> Ken Griffey Jr.\griffke02
>
> Based on the helpful feedback I got in my previous post, now what I need is a 
> pattern that would handle not only all the original input items plus the two 
> new cases. Further, what I would like extracted is everything up to but not 
> including the backslash.
>
> This attempt (of mine) finds everything in the original dataset, but I was 
> unable to expand it to include either the "Sr." or "Jr.":
> ^([a-z,A-Z,\.]+) ([a-z,A-Z]+)
>
> 1. Is there a way my attempt can be expanded so it includes "Sr." or "Jr." 
> when a name has either of them?
> 2. What pattern would you write to accomplish the task?
> --
> 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/8a68d4b5-6d57-4c4c-8cd0-1ed5c30f85d5%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/0cd00ad5-b756-464e-8403-e526d64d9d93%40Spark.


Re: Newbie Seeking Advice

2020-02-29 Thread David G Wagner
What do the currency numbers look like? I mean is there a dollar sign? Is the 
minus sign at front or back?

What you want to do is simple, but not familiar SGML.

So if you can dummy some trans, would make it clearer to me...

Wags ;)
WagsWorld
Hebrews 4:15
Ph(primary) : 408-914-1341
Ph(secondary): 408-761-7391
On Feb 29, 2020, 09:58 -0800, Mark Love , wrote:
> I don't own BBEdit (yet) but think it could solve a problem I have.
>
> PROBLEM:
>
> My credit card company has recently switched the semantics of the QFX file it 
> produces to describe transactions. (For those not familiar with QFX, it's 
> SGML based descriptions of financial activity).  Anyway, when it worked 
> properly charges to the card were described thusly:
>
> TRNTYPE=DEBIT
> TRNAMT=
>
> and payments to the credit card company and merchant refunds were coded as:
>
> TRNTYPE=CREDIT
> TRNAMT=
>
> A recent change to the generated GFX file semantics prevents me from 
> importing it into my personal finance software:  all charges come through as 
> payments and all payments come through as charges.  The root cause is this 
> new encoding in the QFX for charges:
>
> TRNTYPE=CREDIT
> TRNAMT=
>
> and for payments:
>
> TRNTYPE=DEBIT
> TRNAMT=
>
> As you can see, it's just the opposite from what it used to be!!!
>
> The credit card company insists this is correct (confirming that both Quicken 
> and MS Money say they're OK with the change).  But it broke Banktivity, and 
> from spending over 6 hours on the phone with both companies, I expect my only 
> chance to solve this problem is with text manipulation.  Thus my interest in 
> BBEdit.
>
> There seems to be some sort of automation capability in BBEdit where I could 
> run a series of transforms on the QFX file as delivered by the credit card 
> company before importing into Banktivity.  Is this true, and can someone 
> describe the BBEdit commands to transform the QFX file properly?  Here's my 
> take on the automation flow:
>
>
> • open a specified file
> • change all occurrences of CREDIT to XXX
> • Change all occurrences of DEBIT to CREDIT
> • Change all occurrences of XXX to DEBIT
> •  multiplying by -1)>
> • Close transformed file
>
> Any help provided would be greatly appreciated.  BBEdit is clearly overkill 
> for my problem, but for 50-odd bucks it seems worthwhile to me to kill this 
> aggravation.
>
> My environment:  MacOS High Sierra (10.13.6) running on a MacBook Pro early 
> 2011 (to be upgraded this summer to Catalina on a MacBook Pro 16").
>
> Thanks again.
>
> 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/bc0dc03d-3b93-4bb4-bf9f-da0a5f436237%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/a4e274b0-acd6-4b42-a421-3c415e9899b9%40Spark.


Re: GREP help: dig into the report of the cash register

2018-12-04 Thread David G Wagner
You state what you need is in red, but you do not show any date in red. Please 
clarify...

thank you...

Wags ;)
WagsWorld
Hebrews 4:15
Ph(primary) : 408-914-1341
Ph(secondary): 408-761-7391
On Dec 4, 2018, 05:14 -0800, 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 LENTI    20,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 CONTATTO    100,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 LENTI    20,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
> CONTANTE            8,00
>
> CASSA:                01
> 22-04-2017         10:55
> N.SCONTR.FISCALE       4
> t_fiscale 20170422 1826 5
>                   EURO
> SOLUZIONI LAC      23,00
> TOTALE EURO        23,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
> *FATTURE            0,00
> *RICEVUTE           0,00
> NOTE DI CREDITO GIORN.
>                     0,00
>
> 
>        DETTAGLIO
>        OPERAZIONI
> 
> SCONTI              0,00
>       N.    0
> MAGGIORAZ.          0,00
>       N.    0
> BONIFICI            0,00
>       N.    0
> RETTIFICHE          0,00
>       N.    0
> CORRISP. NON RISCOSSI
> *SCONTRINI          0,00
> *RICEVUTE           0,00
> CORRISP. RISCOSSI
> *SCONTRINI      1 234,00
> *FATTURE            0,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.RICEVUTE            0
>
> 
>      DATI GENERALI
> 
> N.LETT.MEM.FISCALE     0
>
> PROGR. AZZERAMENTI   960
> NUM. RIPRISTINI        0
>
> 
> DISPOS.GIORN.ELETTRONICO
>       N.2 DEL 02-05-2014
>        MATR. 05 30005163
>
> CASSA:                01
> 22-04-2017         18:43
> N.SCONTR.FISCALE       6
>
> --
> 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