Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replace all spaces with a new line in CMD

I have a input file of type .txt :

// file.txt
The quick brown dog jumped over the lazy fox. 

Basically I want to use this input file to produce an output file with each string quote-enclosed and on its own line in CMD. Any ideas?

Output should be like this:

'The'

'quick'

 etc...
like image 794
Jonathan Scialpi Avatar asked Sep 15 '25 23:09

Jonathan Scialpi


1 Answers

@echo off
set /p text=<file.txt
(for %%i in (%text%) do echo '%%i')>newfile.txt
like image 87
Stephan Avatar answered Sep 18 '25 16:09

Stephan