2

I remember there used to be a way to split txt files by line in cmd prompt. I can't seem to find any documentation on it.

Anyone have any help?

Thanks!

Ross Ridge
  • 38,414
  • 7
  • 81
  • 112
badsmell
  • 75
  • 11
  • See `Help for` especially the `/f` variant. –  Aug 07 '18 at 21:28
  • Run in a command prompt window `for /?` to get output the help for command __FOR__. Any internal command of Windows command processor `cmd.exe` as well as most external commands which are console applications in directory `%SystemRoot%\System32` can be started with parameter `/?` in a command prompt window to get output the help for the command/application. There are thousands of posts on Stack Overflow using `for /F`, see for example [Print contents of txt file line by line](https://stackoverflow.com/questions/51576615/). Run just `help` to see a list of commands with brief description. – Mofi Aug 08 '18 at 05:08

1 Answers1

-1

for /F "tokens=*" %i in (filename.txt) do @echo %i

Replace filename.txt with your filename, and replace @echo %i with the command you want.

Source: How do you loop through each line in a text file using a windows batch file?

Note: From my brief testing this works in with the standard windows command prompt (cmd), but not with PowerShell.

Luke
  • 18,811
  • 16
  • 99
  • 115