Hey Chris,

This fails on my Mojave system with the stock `awk`.


#Start#Start#Start#
2 In the beginning, God created the heavens and
Xxxxxxccx
#Start#EndOfGen#Start#
#Start#Start#Start#
6 Thus the heavens and the earth were finished,
Xxxxxxxx
#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.
Xxxxxxx
#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 <[email protected]> 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
> 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#

-- 
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/18DA528B-9E6C-4B84-BAD4-1462489AB0ED%40gmail.com.

Reply via email to