Hello hadrons, I haven't used Windows in over 20 years but these may work.

(Obviously I can't test these because ... no Windows)

system ('grep -l "DATAmessage.*3\.0" *.xml > 3.0_files_arraydata.txt') +;
open my $FH, '>', '3.0_files_arraydata.txt' or die "Cannot open '3.0_files_arraydata.txt' because: $!"; { local @ARGV = <*.xml> or die "Cannot find any '*.xml' files\n"; while ( <> ) { if ( /DATAmessage.*3\.0/ ) { print $FH "$ARGV\n"; close ARGV; } } }

system ("mv temp_3.0_files_onixarraydata.txt 3.0_files_arraydata.txt") +;
rename 'temp_3.0_files_onixarraydata.txt', '3.0_files_arraydata.txt' or die "Cannot move 'temp_3.0_files_onixarraydata.txt' because: $! +";

system ("cat *files_arraydata.txt > data2.txt");
open my $FH, '>', 'data2.txt' or die "Cannot open 'data2.txt' because: $!"; { local @ARGV = <*files_arraydata.txt> or die "Cannot find any '*files_arraydata.txt' files\n"; print $FH $_ while <>; }

system ("rm data2.txt");
unlink 'data2.txt' or die "Cannot delete 'data2.txt' because: $!";

system ("sort -u data2.txt > data.txt");
open my $IN, '<', 'data2.txt' or die "Cannot open 'data2.txt' because: $!"; open my $OUT, '>', 'data.txt' or die "Cannot open 'data.txt' because: $!"; { my %unique; print $OUT sort grep { ! $unique{ $_ }++ } <$IN>; }

In reply to Re: Using system (); with Strawberry Perl by jwkrahn
in thread Using system (); with Strawberry Perl by hadrons

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.