1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to? PDir on multiple wildcard patterns...

Discussion in 'Support' started by mathewsdw, Jul 6, 2013.

  1. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    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?
     
  2. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    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.
     
  3. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    0
    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.
     

Share This Page