Okay, easy question (as I've been away from Perl and scripting for *far* too long): I have a log file that I need to sanitize before send to a vendor. The log reads something like this:
7/21/2006 6:22:49 start new visit signin - Requirements Passed 7/21/2006 6:22:49 visitor data captured for JON DOE 7/21/2006 6:22:49 visit record saved for JON DOE 7/21/2006 6:22:49 starting to send print job for JON DOE 7/21/2006 6:22:49 printing: row count is 1 7/21/2006 6:22:49 printing: print badge begin 7/21/2006 6:22:52 printing: in PrintBadges 7/21/2006 6:22:52 printing: about to replace objects 1 7/21/2006 6:22:53 printing: about to start printing 7/21/2006 6:22:55 printing: finished printing 7/21/2006 6:22:55 printing: done 7/21/2006 6:22:55 printing: print badge end 7/21/2006 6:22:59 finished sending print job for JON DOE 7/21/2006 6:22:59 finished with visit sign in for JON DOE 7/21/2006 8:25:42 start new visit signin - Requirements Passed 7/21/2006 8:25:42 visitor data captured for JANE SMITH 7/21/2006 8:25:43 visit record saved for JANE SMITH 7/21/2006 8:25:43 starting to send print job for JANE SMITH 7/21/2006 8:25:43 printing: row count is 1 7/21/2006 8:25:43 printing: print badge begin 7/21/2006 8:25:43 printing: in PrintBadges 7/21/2006 8:25:43 printing: in BdgDsgn_PrintVisitsBadges 7/21/2006 8:25:43 printing: about to replace objects 1 7/21/2006 8:25:44 printing: go object look 7/21/2006 8:25:44 printing: set object look 7/21/2006 8:25:44 printing: got objects 7/21/2006 8:25:44 printing: about to start printing 7/21/2006 8:25:46 printing: finished printing 7/21/2006 8:25:46 printing: done 7/21/2006 8:25:46 printing: print badge end 7/21/2006 8:25:49 finished sending print job for JANE SMITH 7/21/2006 8:25:51 finished with visit sign in for JANE SMITH
The names are always in caps and are the only all caps strings in the document. I want to replace each name with a unique identifier (something generic like AAAAAAAA for JON DOE and BBBBBBBB for JANE SMITH) throughout the document. I know it's a simple solution, basic homework-type stuff but I haven't coded in over two years, and the time crunch to return these logs doesn't afford me the time to refresh my memory. Any quick help available?

In reply to Log cleanup script by abdiel

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.