You need to create titles.txt like this:
dir /s > titles.txt

Then you can work with the code below to put
in the file time/date stamps as you need it.


open(FD1, "<titles.txt") || die "open: $!";
#
while($line1 = <FD1>) {

if ($line1 =~ /Directory/) {
$dirval = $line1;
}

if ($line1 =~ /g1\.jpg/) {
if ($line1 !~ /Directory|<DIR>/) {
$line1 =~ /.{39}(.*)$/;
$filename = $1;
write;
}
}
}
close(FD1);
exit();

format STDOUT =
@<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$filename, $dirval
. D:\<snip>>perl mygrep.pl message.jpg1.jpg Directory of S:\<snip>\images
message.jpg1.jpg Directory of S:\<snip>\images
editFunding1.jpg Directory of S:\<snip>\images
funding1.jpg Directory of S:\<snip>\images
tracking1.jpg Directory of S:\<snip>\images
viewFunding1.jpg Directory of S:\<snip>\images
g1.jpg Directory of S:\<snip>\weirdos
g1.jpg Directory of S:\<snip>\Personal
wag1.jpg Directory of S:\<snip>\Internet redesig
staff-org1.jpg Directory of S:\<snip>\cutouts
training1.jpg Directory of S:\<snip>\cutouts
winning1.jpg Directory of S:\<snip>
free_bg1.jpg Directory of S:\<snip>\PP 2000
swefbldg1.jpg Directory of S:\<snip>\<snip>grist



In reply to Re: Directory comparison by Anonymous Monk
in thread Directory comparison by maxl90

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.