ThisIsMe
ThisIsMe

Reputation: 325

Why does findstr display everything on the same line?

I am trying to display all the .txt files that contain the word hungry in the current directory and its subdirectories, with this command:

findstr /si hungry *.txt

But I have this output:

users\fich1.txt:hungryprojects\ll\ll.txt:Hungry

And I would like it do be displayed in different lines, like:

users\fich1.txt:hungry
projects\ll\ll.txt:Hungry

Any idea?

Upvotes: 2

Views: 134

Answers (1)

jeb
jeb

Reputation: 82307

This happens when the line endings are in MAC style, Carriage Return only instead of carriage return and a line feed.
You have to convert the files first.
You could take a look at dbenhams jrepl.bat hybrid script.

Upvotes: 2

Related Questions