PC Review


Reply
Thread Tools Rate Thread

what does "delims=" mean?

 
 
AAaron123
Guest
Posts: n/a
 
      30th May 2009
for /f "delims=" %%a in ('dir /B *.sql') do call :subr "%%a"
In the above, what does "delims=" mean?I understand "delims=/" but not
"delims="Also, can "do" executed two commands?Thanks


 
Reply With Quote
 
 
 
 
Kelly
Guest
Posts: n/a
 
      30th May 2009
http://www.google.com/search?hl=en&q...&aq=f&oq=&aqi=

--

All the Best,
Kelly (MS-MVP/DTS&XP)

Taskbar Repair Tool Plus!
http://www.kellys-korner-xp.com/taskbarplus!.htm


"AAaron123" <(E-Mail Removed)> wrote in message
news:O3z%(E-Mail Removed)...
> for /f "delims=" %%a in ('dir /B *.sql') do call :subr "%%a"
> In the above, what does "delims=" mean?I understand "delims=/" but not
> "delims="Also, can "do" executed two commands?Thanks
>


 
Reply With Quote
 
VanguardLH
Guest
Posts: n/a
 
      30th May 2009
AAaron123 wrote:

> for /f "delims=" %%a in ('dir /B *.sql') do call :subr "%%a"


My guess is you are ensuring that the default parsing characters of
space and tab are used. You aren't specifying delimiters for the items
added the output list specifying by the filespec for the 'in' operator.
Doesn't seem any point in specifying a null string because the result is
to use the default delimiters.

> Also, can "do" executed two commands?


Separate the commands with & or &&.

& = do next command even if prior command errors.
&& = do next command only if prior command does not error.

Example (using your for-loop):

for /f %%a in ('dir /B *.sql') do echo Processing %%a & call :subr "%%a"

In this case, it doesn't make a difference in using & or &&. But in:

for /f %%a in ('dir /B *.sql') do ren "%%a" "%%a.tmp" && call :subr "%%a"

it will only do the call if the rename worked. There are other
conditional operators for multiple commands. Read:

http://www.microsoft.com/resources/d....mspx?mfr=true
 
Reply With Quote
 
AAaron123
Guest
Posts: n/a
 
      30th May 2009
I saw the following.
Is that another way of executing two commands?

....snip... do (
echo Checking and possibly decompressing "%%a"
compact /u /i /a "%%a"
)

Thanks for the Command shell overview link.
If I had seen that before I'm sure I wouldn't have known it applied to the
command in the for command.

As I understand it you think it would work the same without "delims=". Yes?

Thanks a lot

"VanguardLH" <(E-Mail Removed)> wrote in message
news:gvqd7u$hs2$(E-Mail Removed)...
> AAaron123 wrote:
>
>> for /f "delims=" %%a in ('dir /B *.sql') do call :subr "%%a"

>
> My guess is you are ensuring that the default parsing characters of
> space and tab are used. You aren't specifying delimiters for the items
> added the output list specifying by the filespec for the 'in' operator.
> Doesn't seem any point in specifying a null string because the result is
> to use the default delimiters.
>
>> Also, can "do" executed two commands?

>
> Separate the commands with & or &&.
>
> & = do next command even if prior command errors.
> && = do next command only if prior command does not error.
>
> Example (using your for-loop):
>
> for /f %%a in ('dir /B *.sql') do echo Processing %%a & call :subr "%%a"
>
> In this case, it doesn't make a difference in using & or &&. But in:
>
> for /f %%a in ('dir /B *.sql') do ren "%%a" "%%a.tmp" && call :subr "%%a"
>
> it will only do the call if the rename worked. There are other
> conditional operators for multiple commands. Read:
>
> http://www.microsoft.com/resources/d....mspx?mfr=true



 
Reply With Quote
 
AAaron123
Guest
Posts: n/a
 
      30th May 2009
I had googled before I posted and didn't find the meaning of "delims="
although I did see usages of it.

Did you actually see that with the url you gave me?

As I now understand it, if I left it out I'd get the same result.

However, although it didn't address my question, the second google hit gave
an excellent elementary tutorial of the FOR /F command


Thanks

"Kelly" <(E-Mail Removed)> wrote in message
news:e$(E-Mail Removed)...
> http://www.google.com/search?hl=en&q...&aq=f&oq=&aqi=
>
> --
>
> All the Best,
> Kelly (MS-MVP/DTS&XP)
>
> Taskbar Repair Tool Plus!
> http://www.kellys-korner-xp.com/taskbarplus!.htm
>
>
> "AAaron123" <(E-Mail Removed)> wrote in message
> news:O3z%(E-Mail Removed)...
>> for /f "delims=" %%a in ('dir /B *.sql') do call :subr "%%a"
>> In the above, what does "delims=" mean?I understand "delims=/" but not
>> "delims="Also, can "do" executed two commands?Thanks
>>

>



 
Reply With Quote
 
Twayne
Guest
Posts: n/a
 
      30th May 2009
AAaron123 wrote:
> I saw the following.
> Is that another way of executing two commands?
>
> ...snip... do (
> echo Checking and possibly decompressing "%%a"
> compact /u /i /a "%%a"
> )
>
> Thanks for the Command shell overview link.
> If I had seen that before I'm sure I wouldn't have known it applied
> to the command in the for command.
>
> As I understand it you think it would work the same without
> "delims=". Yes?
> Thanks a lot
>
> "VanguardLH" <(E-Mail Removed)> wrote in message
> news:gvqd7u$hs2$(E-Mail Removed)...
>> AAaron123 wrote:
>>
>>> for /f "delims=" %%a in ('dir /B *.sql') do call :subr "%%a"

>>
>> My guess is you are ensuring that the default parsing characters of
>> space and tab are used. You aren't specifying delimiters for the
>> items added the output list specifying by the filespec for the 'in'
>> operator. Doesn't seem any point in specifying a null string because
>> the result is to use the default delimiters.
>>
>>> Also, can "do" executed two commands?

>>
>> Separate the commands with & or &&.
>>
>> & = do next command even if prior command errors.
>> && = do next command only if prior command does not error.
>>
>> Example (using your for-loop):
>>
>> for /f %%a in ('dir /B *.sql') do echo Processing %%a & call :subr
>> "%%a" In this case, it doesn't make a difference in using & or &&.
>> But in:
>>
>> for /f %%a in ('dir /B *.sql') do ren "%%a" "%%a.tmp" && call :subr
>> "%%a" it will only do the call if the rename worked. There are other
>> conditional operators for multiple commands. Read:
>>
>> http://www.microsoft.com/resources/d....mspx?mfr=true


delims= removes the delimiters from memory.

If you're looking for batch help, XP's greatest place I know of is the
alt.msdos.batch.nt
group on any server still serving up the *.alt groups. I doubt you can
ask a question that would stump those guys<g>! Actual DOS or XP, either
one.

Twayne`




 
Reply With Quote
 
Kelly
Guest
Posts: n/a
 
      30th May 2009
Great news..... )

--

All the Best,
Kelly (MS-MVP/DTS&XP)

Taskbar Repair Tool Plus!
http://www.kellys-korner-xp.com/taskbarplus!.htm


"AAaron123" <(E-Mail Removed)> wrote in message
news:O%238rs$(E-Mail Removed)...
>I had googled before I posted and didn't find the meaning of "delims="
>although I did see usages of it.
>
> Did you actually see that with the url you gave me?
>
> As I now understand it, if I left it out I'd get the same result.
>
> However, although it didn't address my question, the second google hit
> gave an excellent elementary tutorial of the FOR /F command
>
>
> Thanks
>
> "Kelly" <(E-Mail Removed)> wrote in message
> news:e$(E-Mail Removed)...
>> http://www.google.com/search?hl=en&q...&aq=f&oq=&aqi=
>>
>> --
>>
>> All the Best,
>> Kelly (MS-MVP/DTS&XP)
>>
>> Taskbar Repair Tool Plus!
>> http://www.kellys-korner-xp.com/taskbarplus!.htm
>>
>>
>> "AAaron123" <(E-Mail Removed)> wrote in message
>> news:O3z%(E-Mail Removed)...
>>> for /f "delims=" %%a in ('dir /B *.sql') do call :subr "%%a"
>>> In the above, what does "delims=" mean?I understand "delims=/" but not
>>> "delims="Also, can "do" executed two commands?Thanks
>>>

>>

>
>


 
Reply With Quote
 
VanguardLH
Guest
Posts: n/a
 
      30th May 2009
AAaron123 wrote:

> I saw the following.
> Is that another way of executing two commands?
>
> ...snip... do (
> echo Checking and possibly decompressing "%%a"
> compact /u /i /a "%%a"
> )


That is another way. It is grouping or blocking of command. You can do
it in the 'if' command, too.

> As I understand it you think it would work the same without "delims=". Yes?


In a couple test cases, I saw no difference in the filespec output or in
parsing it to the replaceable parameter. It is possible that it would
have an effect when you nest multiple commands to, for example, have a
for-loop use the default delims instead of the one specified in a parent
for-loop. While you could use "delims= " to go back to using the space
character as a delimiter, specifying the default tab character could be
problematic in entering it into the delims string and users that read
the code seeing just a bunch of whitespace and not knowing what was
really there.
 
Reply With Quote
 
AAaron123
Guest
Posts: n/a
 
      31st May 2009
thanks a lot

"VanguardLH" <(E-Mail Removed)> wrote in message
news:gvsau5$rn6$(E-Mail Removed)...
> AAaron123 wrote:
>
>> I saw the following.
>> Is that another way of executing two commands?
>>
>> ...snip... do (
>> echo Checking and possibly decompressing "%%a"
>> compact /u /i /a "%%a"
>> )

>
> That is another way. It is grouping or blocking of command. You can do
> it in the 'if' command, too.
>
>> As I understand it you think it would work the same without "delims=".
>> Yes?

>
> In a couple test cases, I saw no difference in the filespec output or in
> parsing it to the replaceable parameter. It is possible that it would
> have an effect when you nest multiple commands to, for example, have a
> for-loop use the default delims instead of the one specified in a parent
> for-loop. While you could use "delims= " to go back to using the space
> character as a delimiter, specifying the default tab character could be
> problematic in entering it into the delims string and users that read
> the code seeing just a bunch of whitespace and not knowing what was
> really there.



 
Reply With Quote
 
AAaron123
Guest
Posts: n/a
 
      31st May 2009
Thanks a lot

"Twayne" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> AAaron123 wrote:
>> I saw the following.
>> Is that another way of executing two commands?
>>
>> ...snip... do (
>> echo Checking and possibly decompressing "%%a"
>> compact /u /i /a "%%a"
>> )
>>
>> Thanks for the Command shell overview link.
>> If I had seen that before I'm sure I wouldn't have known it applied
>> to the command in the for command.
>>
>> As I understand it you think it would work the same without
>> "delims=". Yes?
>> Thanks a lot
>>
>> "VanguardLH" <(E-Mail Removed)> wrote in message
>> news:gvqd7u$hs2$(E-Mail Removed)...
>>> AAaron123 wrote:
>>>
>>>> for /f "delims=" %%a in ('dir /B *.sql') do call :subr "%%a"
>>>
>>> My guess is you are ensuring that the default parsing characters of
>>> space and tab are used. You aren't specifying delimiters for the
>>> items added the output list specifying by the filespec for the 'in'
>>> operator. Doesn't seem any point in specifying a null string because
>>> the result is to use the default delimiters.
>>>
>>>> Also, can "do" executed two commands?
>>>
>>> Separate the commands with & or &&.
>>>
>>> & = do next command even if prior command errors.
>>> && = do next command only if prior command does not error.
>>>
>>> Example (using your for-loop):
>>>
>>> for /f %%a in ('dir /B *.sql') do echo Processing %%a & call :subr
>>> "%%a" In this case, it doesn't make a difference in using & or &&. But
>>> in:
>>>
>>> for /f %%a in ('dir /B *.sql') do ren "%%a" "%%a.tmp" && call :subr
>>> "%%a" it will only do the call if the rename worked. There are other
>>> conditional operators for multiple commands. Read:
>>>
>>> http://www.microsoft.com/resources/d....mspx?mfr=true

>
> delims= removes the delimiters from memory.
>
> If you're looking for batch help, XP's greatest place I know of is the
> alt.msdos.batch.nt
> group on any server still serving up the *.alt groups. I doubt you can
> ask a question that would stump those guys<g>! Actual DOS or XP, either
> one.
>
> Twayne`
>
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Field Names: "LongName", "ShortName", "Code", "Description","Comments" PeteCresswell Microsoft Access 2 25th Feb 2009 11:41 PM
ReVIEW (Erratum): some shortcut keys not working anymore-----help""""""""PhpApach...WORK WELL!!!! wbrowse@gmail.com Windows XP Help 0 13th Apr 2007 12:29 PM
<FORM METHOD="post" onSubmit="return fieldcheck()" name="orientation" action="http://ws-kitty.BU.edu/AT/survey/orientation/script/write.asp" language="JavaScript"> Joeyej Microsoft ASP .NET 0 4th Jun 2004 08:55 PM
Manual "Windows Update" produces "ActiveX/active scripting" error message even with "LOW" security level setting in "Trusted" Zone Ray2 Windows XP Help 1 14th Nov 2003 06:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:58 PM.