[Chicago-talk] process multiple file on windows

Andy_Bach at wiwb.uscourts.gov Andy_Bach at wiwb.uscourts.gov
Mon Jan 12 13:48:15 PST 2009


> Could anyone tell me how to process multiple files with
>command line on Windows?

>Here is what I got:
perl -nle "print if /abv/" *.txt
Can't open *.txt: Invalid argument.

Yeah, I couldn't get and command line expansion either.  While
dir *.txt

works, nothing else does. You can create a .bat file like:
for %%f in ( %1 ) do perl -nle "print if /abv" %%f

and (say it's p.bat)
C:\perl> p.bat *.tmp

worked here.
C:\perl> help for

gives a fairly confusing (but oddly powerful) explanation of the 'for' op
but it includes a mention of 'Command line Extensions' as an option. This
may be worth persuing for more ... er, command line options.

a
-------------------
Andy Bach
Systems Mangler
Internet: andy_bach at wiwb.uscourts.gov
Voice: (608) 261-5738; Cell: (608) 658-1890

 I like to believe that people in the long run are going to do more to
promote peace than our governments.  Indeed, I think that people
want peace so much that one of these days governments had better
get out ofthe way and let them have it.
                -- Dwight D. Eisenhower



More information about the Chicago-talk mailing list