Aldebaran has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks
Have need for a quick script, but it's just a bit too complicated for me. What I seek is a script that renumbers all these paragraphs correctly and makes the spacing uniform between paragraphs.
Here's the target text. I would expect it to come to the script by means of ARGV:
$ pwd /home/bob/Desktop $ ls 2.lease.txt 2.lease.txt $ cat 2.lease.txt ... 21. ASSIGNMENT: RESIDENT agrees not to transfer, assign or sublet the +premises or any part thereof. 22. PARTIAL INVALIDITY: Nothing contained in this Agreement shall be c +onstrued as waiving any of the OWNER'S or RESIDENT'S rights under the + law. If any part of this Agreement shall be in conflict with the law +, that part shall be void to the extent that it is in conflict, but s +hall not invalidate this Agreement nor shall it affect the validity o +r enforceability of any other provision of this Agreement. 32. RECEIPT OF AGREEMENT: The undersigned RESIDENTS have read and unde +rstand this Agreement and hereby acknowledge receipt of a copy of thi +s Barter Agreement. RESIDENT'S Signature _________________________________________________ +__ Date__________________ OWNER'S or Agent's Signature _________________________________________ +___ Date__________________ $
The match criteria are that it matches an integer followed by a period. I want them re-numbered, beginning with 1. Between paragraphs should be only one blank line.
Thanks for your comment,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: a simple match and replace script
by talexb (Chancellor) on Aug 08, 2017 at 19:43 UTC | |
by Aldebaran (Curate) on Aug 09, 2017 at 02:41 UTC | |
by talexb (Chancellor) on Aug 09, 2017 at 13:33 UTC | |
|
Re: a simple match and replace script
by Athanasius (Archbishop) on Aug 09, 2017 at 03:48 UTC | |
by talexb (Chancellor) on Aug 10, 2017 at 13:32 UTC |