Search found 55 matches

by MicrosoftIsKillingMe
16 Jan 2024 15:52
Forum: DOS Batch Forum
Topic: FOR /R puzzler? (wildcarded folders only, e.g. A*)
Replies: 5
Views: 3449

Re: FOR /R puzzler? (wildcarded folders only, e.g. A*)

That is also valuable and instructive, and provides rich context and valuable, instructive examples. Thank you.
by MicrosoftIsKillingMe
15 Jan 2024 11:28
Forum: DOS Batch Forum
Topic: FOR /R puzzler? (wildcarded folders only, e.g. A*)
Replies: 5
Views: 3449

Re: FOR /R puzzler? (wildcarded folders only, e.g. A*)

I feel short of words in responding. I consulted AI, and the answer is... (As expressed by character Jeff Spicoli of "Fast Times at Ridgemont High") "Awesome! Totally awesome!" That's everything that I could ask for AFAIAC. I incorporated in my .bat calling .bat and success. Solved. I observed somet...
by MicrosoftIsKillingMe
15 Jan 2024 05:32
Forum: DOS Batch Forum
Topic: FOR /R puzzler? (wildcarded folders only, e.g. A*)
Replies: 5
Views: 3449

Re: FOR /R puzzler? (wildcarded folders only, e.g. A*)

Let me add, about redirection, some of you who are highly comfortable and proficient with redirection and piping might be thinking "he's shooting himself in the foot because piping (DIR A*.) is certainly the expedient answer". If so, okay, I'll do it the "right" way. It's just that if I can simply a...
by MicrosoftIsKillingMe
15 Jan 2024 03:34
Forum: DOS Batch Forum
Topic: FOR /R puzzler? (wildcarded folders only, e.g. A*)
Replies: 5
Views: 3449

FOR /R puzzler? (wildcarded folders only, e.g. A*)

FOR /R puzzler? (wildcarded folders only, e.g. A*) I have c:\JOE\ALAN, c:\JOE\ALBERT, c:\JOE\ANNA, c:\JOE\BOB Launching from \JOE\, I want to findstr every file hat.txt that contains the string {cat} (no braces), but only for DIRs that begin with the letter A; and include the DIR in the output, perh...
by MicrosoftIsKillingMe
25 Oct 2021 17:07
Forum: DOS Batch Forum
Topic: right click command line help
Replies: 14
Views: 11247

Re: right click command line help

Thank you - similar to my new understanding that %~p is "already" effectively quoted if there are spaces, but not if there is an ampersand even if there are spaces.

I don't know what I would have done without you guys.
by MicrosoftIsKillingMe
25 Oct 2021 14:28
Forum: DOS Batch Forum
Topic: right click command line help
Replies: 14
Views: 11247

Re: right click command line help

Anyway, I see that you used double quoting. It new works when surrounding with double quotes.

The double quoting wasn't necessary when embedded spaces were in the folder name, but were with the ampsersand. Thanks for getting me to that solution.
by MicrosoftIsKillingMe
25 Oct 2021 14:21
Forum: DOS Batch Forum
Topic: right click command line help
Replies: 14
Views: 11247

Re: right click command line help

(deleted)
by MicrosoftIsKillingMe
25 Oct 2021 08:51
Forum: DOS Batch Forum
Topic: right click command line help
Replies: 14
Views: 11247

Re: right click command line help

I apologize in advance if this has been covered. I bled mucho time searching before posting. I am finding that the "p" in the magic substitution string %%~_1 causes processing failure if an ampersand is in the DIR name, e.g. c:\my dog & pony This is on Win 10, regular CMD, .BAT. %1 is foo.txt (or fo...
by MicrosoftIsKillingMe
11 Feb 2021 02:47
Forum: DOS Batch Forum
Topic: Using RegEx on a pair of lines at same time?
Replies: 6
Views: 5492

Re: Using RegEx on a pair of lines at same time?

BTW, the reason I ended up with "7*" anyway was from a batch %1. The user went foo.bat 7* under the understandable notion that it would return anything with a 7 in it. Methinks I'll need to disallow asterisks in %1 for this project.There's too much risk that the user will either use .* when * is nec...
by MicrosoftIsKillingMe
11 Feb 2021 02:32
Forum: DOS Batch Forum
Topic: Using RegEx on a pair of lines at same time?
Replies: 6
Views: 5492

Re: Using RegEx on a pair of lines at same time?

Just a quick note, suddenly underwater here on other projects... Thank you for your [as always] steady, precise and thorough, and insightful performance. What can I say. I solved my issue with character class -- user error, surprise, surprise. And I can explain why I reached the silly-sounding concl...
by MicrosoftIsKillingMe
10 Feb 2021 17:00
Forum: DOS Batch Forum
Topic: Using RegEx on a pair of lines at same time?
Replies: 6
Views: 5492

Re: Using RegEx on a pair of lines at same time?

What a work of art! I'll need to come back to this when I can put in some time but I'll mention a few things - Yes, /OD within each folder is what I'm accustomed to and my initial intent was to see the /OD grouped sorts, though the other everything at once way SOMETIMES is what I prefer (which I've ...
by MicrosoftIsKillingMe
09 Feb 2021 23:52
Forum: DOS Batch Forum
Topic: Using RegEx on a pair of lines at same time?
Replies: 6
Views: 5492

Re: Using RegEx on a pair of lines at same time?

Note I found Dave's https://ss64.com/nt/findstr-linebreaks.html "FINDSTR - Searching across Line Breaks" but it is confusing where he says "I can't graphically represent the characters" and I don't understand why he shows !CR!*!LF! instead of $^ but anyway that didn't work either - it did not report...
by MicrosoftIsKillingMe
09 Feb 2021 22:26
Forum: DOS Batch Forum
Topic: Using RegEx on a pair of lines at same time?
Replies: 6
Views: 5492

Using RegEx on a pair of lines at same time?

I have a .BAT that reports every found "a.txt" and directory names via something like dir /a /od /s *.* | FINDSTR /I /R /C:"a.txt" /C:" Directory of " (As you maybe guessed I'm using this construct to avoid "false positives" on short file names. It's actually more complex than this but this will suf...
by MicrosoftIsKillingMe
05 Apr 2020 08:44
Forum: DOS Batch Forum
Topic: Runaway problem with FINDSTR "Line {nnn} is too long"
Replies: 1
Views: 5229

Runaway problem with FINDSTR "Line {nnn} is too long"

I have [at least one] irritating file, C:\Windows\SoftwareDistribution\DataStore\DataStore.edb that produces a runaway FINDSTR. (FWIW, the input file is over 2G.) Stderr begins with FINDSTR: Line 2 is too long. FINDSTR: Line 2 is too long. FINDSTR: Line 2 is too long. FINDSTR: Line 3 is too long. FI...
by MicrosoftIsKillingMe
24 Mar 2019 18:53
Forum: DOS Batch Forum
Topic: Directory "file dates" keep changing (for DIR) - Win 10
Replies: 9
Views: 8444

Re: Directory "file dates" keep changing (for DIR) - Win 10

Think of the basic FAT and file system architecture. If I add a file A.TXT to c:\foo, nothing in the file system need change for FOO entries (at least, never needed to until "last accessed" came into being). A file entry for A.TXT with that creation date is created; but that alone would be no reason...