I have a text file called database.txt and the 16th field contains 16:01:08 2007-01-10. I'm trying to archive all records over 45 days old to be appended to archive.txt I've a newbie when it comes to scripting and have been trying to google an answer for a similar question but am having trouble knowing what I should be searching for. Do you know of any examples I can take a look that would accomplish this.

type|address|city|state|size|rent|term|company|contact|phone|email|website|ID|REMOTE_ADDR|HTTP_USER_AGENT|DATE|SORTORDER
MFG|10 Oakmead Pkwy|San Jose|CA |10,000|$1.25|Net|Cushman Wakefield|Tom Cushman|408 555-8777|tom@cushman.com|http://www.google.com|1000000|76.102.98.35|Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)|16:01:08 2007-01-10|1003
LAND|10 Oak|San Jose|CA|14,000|$1.25|Net|Ritchie Commercial|Don Ritchie|408 555-8777|tom@cushman.com|http://www.yahoo.com|1000001|76.102.98.35|Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)|16:28:03 2008-01-10|1002

Thanks,
Chris

In reply to Extracting Line from Text file over 45 days old by chris654

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.