Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

How to? PDir on multiple wildcard patterns...

May
855
0
Maybe there's a way to do this that I haven't figured out yet, but it would sure be nice if I could do a PDir on multiple wildcard patterns without going to the trouble of writing a full-fledged regular expression. (I've been exposed to so many regular expression syntaxes over the years that I'm no longer able to keep them straight in my mind.) Specifically, I often do a PDir like this to find a particular spreadsheet that I'm interested in:
Code:
PDir *.xls /s /A-D /(dy/m/d th:m:s zc fpn) | Sort | List
but I'd also like to do it (and combine the output into a single composite) with a PDir like this:
Code:
PDir *.cvs /s /A-D /(dy/m/d th:m:s zc fpn) | Sort | List
As of yet I haven't found a way to do this except by executing both PDir's individually concatenating their outputs into a single temporary work file which is kind of a pain because it involves multiple steps (including remembering to delete the work file when done).

Is there an easy way to do this? If so, how?
 
Try this:

Code:
PDir /s /A-D /(dy/m/d th:m:s zc fpn) *.cvs;*.xls | Sort | List

Note: I moved the options to be immediately after the command name, which is the only GUARANTEED location for their correct interpretation.
 
Thanks, Steve, that worked of course. It's kind of random where I put the options on commands (the order in which I happen to think of them) because I've never run into a situation where it made a difference until now and I truly did think that where the non-keyword options were was totally irrelevant.
 

Similar threads

Back
Top