Xref: utzoo comp.emacs:5161 gnu.emacs:379 Path: utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!uw-beaver!blake!ogccse!littlei!omepd!merlyn From: merlyn@intelob.intel.com (Randal L. Schwartz @ Stonehenge) Newsgroups: comp.emacs,gnu.emacs Subject: perl code to format Directory (was Re: GNU Emacs Lisp Code Directory) Summary: src attached Keywords: GNU-ONLY Message-ID: <4090@omepd.UUCP> Date: 26 Jan 89 16:51:38 GMT References: <35090@bbn.COM> Sender: news@omepd.UUCP Reply-To: merlyn@intelob.intel.com (Randal L. Schwartz @ Stonehenge) Organization: Stonehenge; netaccess via BiiN, Hillsboro, Oregon, USA Lines: 65 In-reply-to: dsill@RELAY-NSWC.NAVY.MIL In article <35090@bbn.COM>, dsill@RELAY-NSWC writes: | Here's the latest version of my datafile of GNU Emacs Lisp code and | GNU Emacs modifications that have been posted to one of the | Emacs-related mailing lists. The are now over 170 entries. | | In case you missed my December postings, I'm now distributing the | directory as a datafile. I previously posted a UNIX shell/awk script | to produce a report similar to the earlier directories I posted. If | you don't have UNIX or a copy of the report generating script, drop me | a line. | | I've been hoping someone who Lisps would whup up an interface or | report generator in GNU Lisp, but it hasn't happened yet. Something | like lisp-dir-apropos which would pop up a window with formatted info | about matching entries would be nice, if anyone's listening.... Okay, so it isn't Elisp, but it is 'perl'. Try the attached code. It wants the article saved in "NEWS-lib-list" with *nothing* between the newsheader and the first entry (like you posted last time! :-). Appropriate munging will be required to have "perl" located properly and the filename changed if necessary. Enjoy. Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 on contract to BiiN (for now :-), Hillsboro, Oregon, USA. ARPA: <@iwarp.intel.com:merlyn@intelob.intel.com> (fastest!) MX-Internet: UUCP: ...[!uunet]!tektronix!biin!merlyn Standard disclaimer: I *am* my employer! Cute quote: "Welcome to Oregon... home of the California Raisins!" ====== cut here ====== no .signature at end (I hope) ====== #!/ba/merlyn/.bin/perl open(F, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>... (^<<<<<<<<<<<<<<<<<<<...) $cont $auth . while () { last if /^$/; next unless /^Date:\s*(\S.+\S)\s*$/; $postdate = $1; } die if eof(F); while () { next if /^Name.Author/; ($name, $auth, $cont, $desc, $date, $vers) = split(/\|/); write; }