Search found 1973 matches

by penpen
26 Jun 2013 03:24
Forum: DOS Batch Forum
Topic: Efficiently passing multiple switches to a batch file?
Replies: 6
Views: 7804

Re: Efficiently passing multiple switches to a batch file?

Using the set command on all parameter and doing string operations on it is a real good idea Squashman. Up to now i did it in similar way as Aacini has done it. But you may max your idea out: @echo off setlocal rem Erase all existent variables to show the created ones at end for /F "delims==&qu...
by penpen
25 Jun 2013 19:41
Forum: DOS Batch Forum
Topic: Return character of specific position in a line
Replies: 16
Views: 13747

Re: Return character of specific position in a line

Hi, i hope this post is not too late, but i think the efficiency could be improved by using the buffer capacity of STDIN and STDERR, the match.txt receives the redirected output of STDIN and nomatch.txt that of STDERR. This solution advantages are: - not to use more than one file handle per outputfi...
by penpen
24 Jun 2013 16:07
Forum: DOS Batch Forum
Topic: new findstr bug
Replies: 20
Views: 26231

Re: new findstr bug

I have thought of sending the following as private message, but if 50% of posters have problems with what i wrote, there may be much more readers with the same problem, so i have decided to post this. I'm not sure what problem you have with these two examples, so i try a detailed explanation of: 1) ...
by penpen
24 Jun 2013 07:52
Forum: DOS Batch Forum
Topic: new findstr bug
Replies: 20
Views: 26231

Re: new findstr bug

@Squashman I think the real question is why does it work when it is not Quoted but does not work when it is quoted. This is easy: the unquoted version produces two chars (the <nul part produces it). You can make it visible by creating a file named piped.bat with the following content: @echo off setl...
by penpen
24 Jun 2013 07:21
Forum: DOS Batch Forum
Topic: new findstr bug
Replies: 20
Views: 26231

Re: new findstr bug

You are making it sound like the SET command is executed once for each ECHO in the FOR loop
Sry, for this misunderstanding, it was meant as you say it then:
The FOR loop executes all the iterations before it moves on to the SET command.
by penpen
24 Jun 2013 06:44
Forum: DOS Batch Forum
Topic: new findstr bug
Replies: 20
Views: 26231

Re: new findstr bug

Yes, the set command should be executed after the echo commands in the for loop. Their output form a multiline document with only one invalid line at the end. It's the same Sponge Belly does in the opening post using the command type. I have written an own version just to change the number of lines ...
by penpen
23 Jun 2013 18:30
Forum: DOS Batch Forum
Topic: new findstr bug
Replies: 20
Views: 26231

Re: new findstr bug

These examples should only show, that this error handling is done per line,
not only on the first char in the pipe:
-the upper version interrupts execution, and so ignores the single char at the last line, while
-the lower version is fully executed.
by penpen
23 Jun 2013 17:30
Forum: DOS Batch Forum
Topic: new findstr bug
Replies: 20
Views: 26231

Re: new findstr bug

Hi there, i'm sorry, but i'm sure that this is not a bug in findstr. Somewhen in 2001 or 2002 i have read how findstr handles redirected input within the XP dos shell - it's long ago, so i can't remember the link address; and i havn't found it in actual MSDN - sry for that - but i'm sure that it was...