C
cliff
hello,
findstr output has a problem when the search word happens to be on a last
line of the preceding file. The output will be garbled with the succeeding
file searched.
e.g here shows a sample command line session showing the problem with
file1.txt and file2.txt :
c:\ > type file1.txt
test
findstr
c:\ > type file2.txt
test
findstr
c:\ > findstr "findstr" file1.txt file2.txt
file1.txt:findstrfile2.txt:findstr
The desired output is :
file1.txt:findstr
file2.txt:findstr
The last line should not have a newline for file1.txt. Try using notepad and
make sure the last line does not have a newline. I also noticed that "edit"
also seems to insert a newline for the last line(but not notepad).
I also tested grep(a sort of findstr equivalent) and it does not have a this
problem when given the same file1.txt and file2.txt.
Will this problem be fixed? It could cause some subtle problems in scripts
when pipes are used.
This problem exists on Windows 2000 and Windows XP.
regards,
Cliff
findstr output has a problem when the search word happens to be on a last
line of the preceding file. The output will be garbled with the succeeding
file searched.
e.g here shows a sample command line session showing the problem with
file1.txt and file2.txt :
c:\ > type file1.txt
test
findstr
c:\ > type file2.txt
test
findstr
c:\ > findstr "findstr" file1.txt file2.txt
file1.txt:findstrfile2.txt:findstr
The desired output is :
file1.txt:findstr
file2.txt:findstr
The last line should not have a newline for file1.txt. Try using notepad and
make sure the last line does not have a newline. I also noticed that "edit"
also seems to insert a newline for the last line(but not notepad).
I also tested grep(a sort of findstr equivalent) and it does not have a this
problem when given the same file1.txt and file2.txt.
Will this problem be fixed? It could cause some subtle problems in scripts
when pipes are used.
This problem exists on Windows 2000 and Windows XP.
regards,
Cliff