Here's an outline of your program:

open directory handle for E:\temp while the handle returns filenames match filename against spec. - capture year and day of year. if name does not match, skip to the next file. test for existence of target path. if does not exist, create it. move file to new location.

Between the outline above and Fletch's pointers to docs you should be able to put something together.

You should also take a look at next. perlretut will help you match the filenames to your spec and capture the information you want.

Once you have a script that works, you can create an entry in Scheduled Tasks.

Also worth mentioning, many tutorial neglect to suggest using strict, warnings and diagnostics. I strongly recommend using all 3 when starting out. diagnostics can be skipped after you've learned to interpret Perl's compiler alerts.


TGI says moo


In reply to Re: Perl for windows file parsing by TGI
in thread Perl for windows file parsing by mab623

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.