note
vitoco
<p>AFAIK, wildcards in OS boxes are expanded by programs, not by the shell (cmd.exe) as in *nix. Perl will keep "*" as an argument, and it's illegal as a filename when interpreted by <c><></c> operator.</p>
<p>You may consider this:</p>
<code>
FOR %F IN (*) DO perl -pe "" "%F" >> ..\newfile.txt
</code>
<p>but it's better to use Win's built-in commands, like <c>TYPE</c> or <c>COPY</c>, as it was already said.</p>
<p>Note that <c>newfile.txt</c> must be empty or must not exists before the <c>FOR</c>, because <c>>></c> opens it for append on each iteration.</p>
<p><b>Update:</b> Using globs:</p>
<code>
perl -e "while (<*>) {open(F,$_) or next;while(<F>){print}/}}" > ..\newfile.txt
</code>
<p>Note: this code has errors, but works as an example.</p>
<p>BTW, it seems that files order is not important.</p>
798822
798835