OK - I have gotten along much farther now with your help.

I am able to get the list of files from the remote server, and create a local text file with the 10 most recent files.

I just need a little more help. I need to apply a regex (I think) as part of the process, as I need the date and time section each of the 10 file for the next step.

I have this as my last section, giving me the last 10 files in the list:

open(FILE, "<filelist.txt"); @file = <FILE>; chomp @file; close FILE; open (MYFILE, '>links.txt'); print MYFILE "$file[-1]\n"; print MYFILE "$file[-2]\n"; print MYFILE "$file[-3]\n"; print MYFILE "$file[-4]\n"; print MYFILE "$file[-5]\n"; print MYFILE "$file[-6]\n"; print MYFILE "$file[-7]\n"; print MYFILE "$file[-8]\n"; print MYFILE "$file[-9]\n"; print MYFILE "$file[-10]\n"; close (MYFILE);

Can I add something to that, that will use this regex "\d\d\d\d\d\d\d\d\_\d\d\d\d" and print just the portion of the filename that matches for each of the 10 files.

I hope that made sense.

Thanks again everyone for your help!

John


In reply to Re: Remote Directory listing by johnfl68
in thread Remote Directory listing by johnfl68

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.