Hello David,

Here is a Text Filter that might work.

Copy and paste the following into a file. ( Starting with the ‘#' and ending 
with the last ‘}’ )


#!/usr/bin/env awk -f

BEGIN {
        RS = "#Start#"
        ORS = ""
        FS = "\n"
        OFS = "\n"
}

{ 
        sub( /[0-9]+/, NR , $2 )
        print "#Start#" $0
}


Name it something like ’Set Chapter Num.awk’ and save it to 
'~/Library/Application Support/BBEdit/Text Filters'.

Then open the file you want to edit and run the script from the ’Text > Apply 
Text Filter’.

Hope it works.
— Chris(topher)?



> On Jan 5, 2022, at 12:15 PM, David G Wagner <[email protected]> wrote:
> 
> I have the following data:
> 
> #Start#
> 1 In the beginning, God created the heavens and
> Xxxxxxccx
> #EndOfGen#
> #Start#
> 1 Thus the heavens and the earth were finished,
> Xxxxxxxx
> #EndOfGen#
> #Start#
> 1 Now the serpent was more crafty than any other beast of the field that the 
> LORD God had made.
> Xxxxxxx
> #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
> Xxxxxxccx
> #EndOfGen#
> #Start#
> 2 Thus the heavens and the earth were finished,
> Xxxxxxxx
> #EndOfGen#
> #Start#
> 3 Now the serpent was more crafty than any other beast of the field that the 
> LORD God had made.
> Xxxxxxx
> #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 "[email protected]" 
> rather than posting here. Follow @bbedit on Twitter: 
> <https://twitter.com/bbedit <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 [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/bbedit/5ab44bf1-95cd-4ca8-aa4c-d798f9d12deb%40Spark
>  
> <https://groups.google.com/d/msgid/bbedit/5ab44bf1-95cd-4ca8-aa4c-d798f9d12deb%40Spark?utm_medium=email&utm_source=footer>.

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "[email protected]" 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/8EB64A5D-5E2F-4E7A-B52F-553DA8A693BB%40rustydogink.com.

Reply via email to