mes new roman, new york, times, serif;font-size:12pt">I was thinking of Gre=
p as well.
The problem is simple (maybe not):
-Its a story text f=
ile in acsii.
-It has many chapters
-The chapter index numbers 1 - 13=
are fine, skips 14, and continues with 15 to 75.
-The format of the cha=
pter line (all 75 are in 1 file) is:
"Chapter XX: Chapter Name" Where XX=
is any number from 0 - 9, counting all 75 chapters.
I was thinking =
of grep to find the chapter lines (which I can do and does work) but changi=
ng the numbers is what I cant figure out.
grep 'Chapter' /file name&=
nbsp; - gets the chapter lines and posts them. But changing them?
W- I can remove chapters 1 - 13 temporarily while this change happens.
div style=3D"font-family: times new roman,new york,times,serif; font-size: =
pan style=3D"font-weight: bold;">From: Kevin Mark <kevin.mark=
pan style=3D"font-weight: bold;">Subject: Re: [NYLXS - HANGOUT] =
A simple perl script
=0AOn Wed, Dec 14, 2011 at 04:27:39PM =
-0800, Elfen Magix wrote:
> I need a simple thing that goes through a=
file to find "Chapter [and a number]
> ". Then it must increment tha=
t number by 1 and resave the file without altering
> nothing else.
> I know I've seen this, and even wrote one years ago myself, =
but I cant for the
> life of me remember how!
That is sort-of a loose definition for a program specification.
its one line in one file, you can just open it in vi and search for it and =
if you need it done in 10's or 100's of places, if might be a fe=
w lines of sed, awk or grep.
grep "Chapter" filename