NVIT
asked on
FindStr works only with 1 char searches
In a Windows 7 cmd window, I report on Windows Updates via:
When I search test_csv.csv with findstr, it doesn't work with more than 1 char. But, when searched for a single character, it works and returns the string with SPACEs between each letter (I put periods for clarity):
I thought changing the /format:csv switch to /format:texttablewsys would fix it. e.g.:
No joy.
In notepad++, I select all the text in test_csv.csv and save it to a new file.
Now, findstr works on multiple characters.
So, notepad++ is removing the invisible characters.
Is there a wmic switch to tell it to NOT put the invisible characters, e.g. change the character coding? Or, another way?
wmic qfe list brief /format:csv>test_csv.csv
When I search test_csv.csv with findstr, it doesn't work with more than 1 char. But, when searched for a single character, it works and returns the string with SPACEs between each letter (I put periods for clarity):
findstr /r /i /c:"6" "test_csv.csv"
.D.H.3.4.G.S.W.1. .S.e.c.u.r.i.t.y. .U.p.d.a.t.e. .K.B.3.1.0.8.6.6.4. .N.T. .A.
..T.H.O.R.I.T.Y. .S.Y.S.T.E.M. .1. .1.3. .2.0.1.6.
Using notepad++ or Excel, I open test_csv.csv. It looks normal.I thought changing the /format:csv switch to /format:texttablewsys would fix it. e.g.:
wmic qfe list brief /format:texttablewsys>test_text.txt
No joy.
In notepad++, I select all the text in test_csv.csv and save it to a new file.
Now, findstr works on multiple characters.
findstr /r /i /c:"2016" "test_csv_new.csv"
So, notepad++ is removing the invisible characters.
Is there a wmic switch to tell it to NOT put the invisible characters, e.g. change the character coding? Or, another way?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER