Findstr Slash v ärgert mich - Ersatz gesucht.
Hallo liebe Kollegen!
Da findstr /v seltsames Verhalten aufweist (sieht nach einem Bug aus, aber das will ich hier nicht breittreten, nur soviel: es hat nichts mit vermeintlich verwendeten Punkten zu tun), suche ich nach Ersatz. Welches andere Kommandozeilentool beherrscht diese Art Filterung? (findstr /v "String1 String2 ..." Zieldatei gibt alle Zeilen einer Textdatei aus, die nicht String1 und String2 und... enthalten)
Da findstr /v seltsames Verhalten aufweist (sieht nach einem Bug aus, aber das will ich hier nicht breittreten, nur soviel: es hat nichts mit vermeintlich verwendeten Punkten zu tun), suche ich nach Ersatz. Welches andere Kommandozeilentool beherrscht diese Art Filterung? (findstr /v "String1 String2 ..." Zieldatei gibt alle Zeilen einer Textdatei aus, die nicht String1 und String2 und... enthalten)
Please also mark the comments that contributed to the solution of the article
Content-Key: 173215
Url: https://administrator.de/contentid/173215
Printed on: May 15, 2024 at 03:05 o'clock
14 Comments
Latest comment
Salü,
ähmm insider? a la Biber & Bastla intern
<code type plain>
N:\>ver
Microsoft Windows XP [Version 5.1.2600]
N:\>type C:\script\test\finderstringer.ini
1 String1
2 String2
3 String3
...
Hallo DWW
N:\>findstr /v "String1 String2 ..." C:\script\test\finderstringer.ini
3 String3
Hallo DWW
N:\>
Zeile 4 ist wirklich eine Leerzeile.
Wo klemmt es denn?
Doch bitte lass es uns breittreten, denn wir (hier) nutzen doch immer gerne solche ollen Werkzeuge, da sollte man jeden Bockug kennen, sonst fällt doch der nächste auch mal auf die Nase...
Gruß
aber das will ich hier nicht breittreten,
ähmm insider? a la Biber & Bastla intern
<code type plain>
N:\>ver
Microsoft Windows XP [Version 5.1.2600]
N:\>type C:\script\test\finderstringer.ini
1 String1
2 String2
3 String3
...
Hallo DWW
N:\>findstr /v "String1 String2 ..." C:\script\test\finderstringer.ini
3 String3
Hallo DWW
N:\>
Zeile 4 ist wirklich eine Leerzeile.
Wo klemmt es denn?
Doch bitte lass es uns breittreten, denn wir (hier) nutzen doch immer gerne solche ollen Werkzeuge, da sollte man jeden B
Gruß
Zitat von @DerWoWusste:
Oh
es ist nicht so, dass ich /i nicht kenne. Aber warum wirkt das hier so?
Danke!
Oh
es ist nicht so, dass ich /i nicht kenne. Aber warum wirkt das hier so?
Danke!
Aloha,
tbh: Eine gute Frage, auf die ich selber keine Antwort weiß aber i.d.R. würde man auch nicht so Filtern wie hier im Beispiel ^_^
greetz André
Datei Input.txt
<code type=plain">
C:\windows\WindowsUpdate.log
C:\windows\Logs\CBS\CBS.log
C:\windows\rescache\rc0009\ResCache.hit
C:\windows\ServiceProfiles\NetworkService\AppData\Local\Temp\MpCmdRun.log
C:\windows\servicing\Sessions\Sessions.back.xml
C:\windows\servicing\Sessions\Sessions.xml
C:\windows\SoftwareDistribution\ReportingEvents.log
C:\windows\SoftwareDistribution\DataStore\DataStore.edb
C:\windows\SoftwareDistribution\DataStore\Logs\edb.chk
C:\windows\SoftwareDistribution\DataStore\Logs\edb.log
C:\windows\System32\catroot2\dberr.txt
C:\windows\System32\LogFiles\Scm\3cdb3c57-5945-4fa9-8e4d-f8bd141f0f8f
C:\windows\System32\LogFiles\Scm\521d1619-41b3-4344-9aef-046f98f949a5
C:\windows\System32\LogFiles\Scm\5c571bff-df7d-4678-8297-7a6e5833b2e3
C:\windows\System32\LogFiles\Scm\5ffe3740-3775-41b7-aa9c-84632a1c1105
C:\windows\System32\LogFiles\Scm\69110d7b-41dc-4e9d-bdd3-c826c7db613b
C:\windows\System32\LogFiles\Scm\afece848-8da2-461b-b5e6-cbef57a4df7d
C:\windows\System32\LogFiles\Scm\c4e94ce6-2386-4c13-a712-f621743306ab
C:\windows\System32\LogFiles\Scm\c7847981-48e6-476f-9581-4bbd8e73f7c5
C:\windows\System32\LogFiles\Scm\c925dbcf-37d6-449f-9035-db1a3e2805af
C:\windows\System32\LogFiles\Scm\cd264f70-fd14-48ea-9d74-f52f1d1d3f89
C:\windows\System32\LogFiles\Scm\ddb62c95-d63d-4a59-b7c5-224fa446a980
C:\windows\System32\LogFiles\Scm\ed193743-7050-42e1-9d98-60bf608154af
C:\windows\System32\LogFiles\Scm\ee644074-1d4a-432a-801a-840d85f9b1fd
C:\windows\Temp\EventCombMT.txt
C:\windows\Temp\MpCmdRun.log
C:\windows\winsxs\ManifestCache\a786a517e28d5687_blobs.bin
Datei Suchliste.txt
<code type=plain">
/V C:\windows\servicing\Sessions
/V C:\windows\Temp\MpCmdRun
/V C:\windows\System32\catroot2
/V C:\windows\debug\WIA\wiatrace
/V C:\windows\SoftwareDistribution
/V C:\windows\WindowsUpdate
/V C:\windows\Temp
/V C:\windows\Logs
/V C:\windows\rescache
/V C:\windows\AppCompat
/V C:\windows\System32\LogFiles
/V C:\windows\ServiceProfiles\LocalService\AppData\Local\FontCach
/V C:\windows\debug\PASSWD.LOG
/V C:\windows\bootstat
/V C:\windows\setupact
/V C:\windows\debug\wlms
/V C:\windows\Tasks\SCHEDLGU
/V C:\windows\System32\catroot2e
/V C:\windows\ServiceProfiles\NetworkService\AppData\Local\Temp
/V C:\windows\winsxs\ManifestCache
/V C:\windows\ServiceProfiles\NetworkService
Edit: Die Suchliste ist zu lang. Mit weniger Begriffen/Text klappt es.
Befehl oder Batch
<code type=plain">
findstr /G:suchliste.txt input.txt
<code type=plain">
C:\windows\WindowsUpdate.log
C:\windows\Logs\CBS\CBS.log
C:\windows\rescache\rc0009\ResCache.hit
C:\windows\ServiceProfiles\NetworkService\AppData\Local\Temp\MpCmdRun.log
C:\windows\servicing\Sessions\Sessions.back.xml
C:\windows\servicing\Sessions\Sessions.xml
C:\windows\SoftwareDistribution\ReportingEvents.log
C:\windows\SoftwareDistribution\DataStore\DataStore.edb
C:\windows\SoftwareDistribution\DataStore\Logs\edb.chk
C:\windows\SoftwareDistribution\DataStore\Logs\edb.log
C:\windows\System32\catroot2\dberr.txt
C:\windows\System32\LogFiles\Scm\3cdb3c57-5945-4fa9-8e4d-f8bd141f0f8f
C:\windows\System32\LogFiles\Scm\521d1619-41b3-4344-9aef-046f98f949a5
C:\windows\System32\LogFiles\Scm\5c571bff-df7d-4678-8297-7a6e5833b2e3
C:\windows\System32\LogFiles\Scm\5ffe3740-3775-41b7-aa9c-84632a1c1105
C:\windows\System32\LogFiles\Scm\69110d7b-41dc-4e9d-bdd3-c826c7db613b
C:\windows\System32\LogFiles\Scm\afece848-8da2-461b-b5e6-cbef57a4df7d
C:\windows\System32\LogFiles\Scm\c4e94ce6-2386-4c13-a712-f621743306ab
C:\windows\System32\LogFiles\Scm\c7847981-48e6-476f-9581-4bbd8e73f7c5
C:\windows\System32\LogFiles\Scm\c925dbcf-37d6-449f-9035-db1a3e2805af
C:\windows\System32\LogFiles\Scm\cd264f70-fd14-48ea-9d74-f52f1d1d3f89
C:\windows\System32\LogFiles\Scm\ddb62c95-d63d-4a59-b7c5-224fa446a980
C:\windows\System32\LogFiles\Scm\ed193743-7050-42e1-9d98-60bf608154af
C:\windows\System32\LogFiles\Scm\ee644074-1d4a-432a-801a-840d85f9b1fd
C:\windows\Temp\EventCombMT.txt
C:\windows\Temp\MpCmdRun.log
C:\windows\winsxs\ManifestCache\a786a517e28d5687_blobs.bin
Datei Suchliste.txt
<code type=plain">
/V C:\windows\servicing\Sessions
/V C:\windows\Temp\MpCmdRun
/V C:\windows\System32\catroot2
/V C:\windows\debug\WIA\wiatrace
/V C:\windows\SoftwareDistribution
/V C:\windows\WindowsUpdate
/V C:\windows\Temp
/V C:\windows\Logs
/V C:\windows\rescache
/V C:\windows\AppCompat
/V C:\windows\System32\LogFiles
/V C:\windows\ServiceProfiles\LocalService\AppData\Local\FontCach
/V C:\windows\debug\PASSWD.LOG
/V C:\windows\bootstat
/V C:\windows\setupact
/V C:\windows\debug\wlms
/V C:\windows\Tasks\SCHEDLGU
/V C:\windows\System32\catroot2e
/V C:\windows\ServiceProfiles\NetworkService\AppData\Local\Temp
/V C:\windows\winsxs\ManifestCache
/V C:\windows\ServiceProfiles\NetworkService
Edit: Die Suchliste ist zu lang. Mit weniger Begriffen/Text klappt es.
Befehl oder Batch
<code type=plain">
findstr /G:suchliste.txt input.txt
Aloha,
zu deinem P.S.: zwar arbeite ich selbst nicht damit aber eventuell wäre grep (ist auch für Windows verfügbar) eine mögliche Alternative.
greetz André
zu deinem P.S.: zwar arbeite ich selbst nicht damit aber eventuell wäre grep (ist auch für Windows verfügbar) eine mögliche Alternative.
greetz André
@bastla
Bei mir auch. Ich hatte beim Testen Fehler gemacht.
Man darf die Parameter nur ent oder weder einsetzen, nicht im Kommando und in der /G-Datei.
Gruß
Bei mir auch. Ich hatte beim Testen Fehler gemacht.
Man darf die Parameter nur ent oder weder einsetzen, nicht im Kommando und in der /G-Datei.
Gruß