Batch Tutorial 10 - FOR Loops

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Excellent tutorial! Here's why:

This is the right way to introduce the for-next control structure, because all the remaining forms of for-next, including those that involve folder and file processing, are derived from these two primitive forms. Because the for-next loop is often used for folder and file processing, many beginners jump right into the folder and file processing forms of for-next, which I believe is a mistake, because the abstractions used to select the folders and files being processed often obscure the underlying behavior of the for-next loop. When viewing the combined effect, it isn't always clear exactly what is being done by the folder and file operations encapsulated within the abstract expressions, and what is being done by the for-next processing.

If you first learn how the for-next control structure works (as described in this video), and then add on the abstractions used in folder and file processing, you will have a much better understanding of how the for-next loops that process folders and files actually work, and will know how to properly code the for-next loop to perform folder and file operations and obtain the results you want.

My only suggestion is to the author is add some of the coding examples shown in the video to the comments section.

shadetreesam
Автор

Thanks for the tutorial although I think you talked way too fast. I am trying to look at a directory and run every file with a specific extension. I am not sure how to do that

afifkhaja
Автор

I only knew how to do this in Java before I watched this, and gave up on making a C# utility because it was taking me too long. This is the perfect bodge-it-together solution for making a number of folders necessary for files, and I'd bet I can make it work with renaming files as necessary too

ingamelevi
Автор

Your explanation is very well sorted out. A lot of tutors on the web just don't explain half of the functions which leaves me guessing about the workings of this command. Thanks

typwachtwoordopnieuw
Автор

for /f "tokens=1* delims=0123456789" %%a in ("A0%VAR:"=%") do (
if not "%%b"=="" goto :invalid
)

someone can explain me what this does? specifically the part ("A0%VAR:"=%") I can't get it

what does A0% means?

badbunnyfreaky
Автор

You are really the best teacher in this world !!

Kingmastercool
Автор

if i have a text file that contains Hello World!
can i display it like this? World! Hello
and also is it possible to save it into another text file?

justforFUN-wcoc
Автор

I recommend using Sublime Text for scripting in Batch. It's much better!

lucaslindgren
Автор

Hey, great tutorial, what version of notepad are you using, i am not getting those color highlighting for functions and braces

aeiou
Автор

Wait this is from all the way back in 2011? I was 11 when this tutorial was uploaded.

ingamelevi
Автор

Is there any reason you use single ' ' instead of " "?

hamptonford
Автор

This is great. I wanted to know how to read 2nd row and 2nd column of a csv file

kirankulkarni
Автор

thanks now i can make a file that rickrolls people 69 times

thimitha
Автор

what if I have to select data of token 2 depending on token one?

krutarthraut
Автор

dill-li-meter, lol, great video thanks for the help!

jasonYT
Автор

Thank you. I got a solution. Good tutorial

sivakrishnadindi
Автор

for %%? in (A) do if /I "%C%"=="%%?" goto A
for %%? in (B) do if /I "%C%"=="%%?" goto B

plz what is this can u say

mcqmuster
Автор

how do you know which letter variable you should use?

Akathysia
Автор

good video....but "hello joe...I am black?" duddddeeee

kevinc
Автор

Can anybody help me fo the code? 🙏

Write a program in batch file using conditional statement that let the user plays a simple jack n poy game.

The instruction of this code: there are 2 players (player 1 and player 2). The turn starts at player 1 then player 2. The allowed inputs of both players are:
P – - Paper
R – - Rock
S - Scissor
if the user tries to input other character aside from the 3. Create a goto function that allows the user to input again.

nimzgrenade