MESSAGE
DATE | 2011-12-14 |
FROM | Kevin Mark
|
SUBJECT | Re: [NYLXS - HANGOUT] A simple perl script
|
On 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 that 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! > > Thanks. That is sort-of a loose definition for a program specification. if its one line in one file, you can just open it in vi and search for it and fix it. if you need it done in 10's or 100's of places, if might be a few lines of sed, awk or grep.
grep "Chapter" filename would be the basic idea -- | .''`. == Debian GNU/Linux ==.| http://kevix.myopenid.com......| | : :' : The Universal OS....| mysite.verizon.net/kevin.mark/.| | `. `' http://www.debian.org/.| http://counter.li.org [#238656]| |___`-____Unless I ask to be CCd,.assume I am subscribed._________|
* TwingyAFK is shopping for 17" flat panel * aav sells TwingyAFK a piece of plywood
|
|