the file content
DD: 11/09/2009 AU: jas dimaano PP: Employee ID list PP: (489459) Jas = DS16 -> with SPi since 2005/04/04 AND with ECO ever + since PP: Sam = FT35 -> resigned last 09-03-2008 PP: Evan = AT89 -> transferred last 20070605 to Journals PP: there's more... === DD: july 11, 2009 AU: Jr s. Tolentino, -editor PG: page 9 PP: Earn points now! PP: Yes! You heard it right! (635436)
my code foe the extract numeric id is
#!usr/local/bin/perl $filename = "input.txt"; open (FILE,"<$filename"); @fileinput=<FILE>; close(FILE); foreach $line(@fileinput) { my $test=($line); #add written by and capital the first letter of each word if($test=~s/AU: \b(\w+)|AU: \b(w+)\s\b(w+)/AU: Written by: \u$1 \u$2 +/g) { print $test; } }
the output went to DD: 11/09/2009 AU: jas dimaano PP: Employee ID list PP: Jas = DS16 -> with SPi since 2005/04/04 AND with ECO ever since PP: Sam = FT35 -> resigned last 09-03-2008 PP: Evan = AT89 -> transferred last 20070605 to Journals PP: there's more... === DD: july 11, 2009 AU: Jr s. Tolentino, -editor PG: page 9 PP: Earn points now! PP: Yes! You heard it right! <code>

Where's the numeric id go? how can I place it with the tag 'ID: ' above the AU: tag?


In reply to Where is now the extract numeric id in the parenthesis by allison

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.