Cmd Medium · Lesson 1 · On the house

Advanced for /f

Parse command output and files. Lesson 1 is free — on the house.

Lessons · Cmd Medium · Lesson 1 of 10 · On the house

Advanced for /f

Parse command output and files.

Illustration for Cmd
Lesson 1 is on the house.

for /f "tokens=1,2 delims=," %%A in (file.csv) do ... splits lines into tokens.

Usebackq lets you quote filenames and capture command output with ` or '.

skip=N ignores header lines; eol= sets comment characters.

Watch Unicode/encoding — for /f can mangle unexpected code pages.

Keep tokens simple; escalate to PowerShell when CSV gets nested/quoted complex.

forf

for /f "tokens=1,2 delims==" %A in ('set') do @echo %A
Match this when you type.

Quiz

for /f tokens= selects?

Quiz

delims= sets?

Quiz

skip=1 is useful for?

Quiz

When CSV quoting gets hard?

Check

Match the still for: Advanced for /f.

Open-book: the answers are on this page. Pass every quiz and check (5) to mark the lesson done. This visit: 0/5.