I was trying to setup a batch-file that uses findstr to kill all lines with a certain pattern. The sourcefile i want to analyse looks like this (i changed all values except of the 16th to numbers, usually they are names, urls, empty or single characters like Y/N):
ProductCode|SkuID|Bestellnr|ProductName|locale_de-DE_ProductName|locale_it-IT_ProductName|locale_nl-NL_ProductName|locale_fr-FR_ProductName|locale_en-GB_ProductName|locale_da-DA_ProductName|locale_cs-CZ_ProductName|locale_sv-SE_ProductName|locale_pl-PL_ProductName|locale_sk-SK_ProductName|ProductType|ProduktLink|OnlineAvailability|ProductNumber|IsProdukt|TerritoryAvailability|Category|SubCategory|ImageLink|Status|Flag0|Flag1|Flag2
0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|Y|17|18|19|20|21|22|23|24|25|26
0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|N|17|18|19|20|21|22|23|24|25|26
0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|N|17|18|19|20|21|22|23|24|25|26
0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|Y|17|18|19|20|21|22|23|24|25|26
0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|Y|17|18|19|20|21|22|23|24|25|26
I just want to exclude all lines that have a N in the 16th parameter. Therefore i came up with a regex pattern that does this:
^([^|]*\|){16}N
Demo that RegEx works (online ressource)
https://regex101.com/r/mE5HVR/1/
When i try to use this feature with findstr like this:
FINDSTR /V "^([^|]*\|){16}N" H:\BatchTest\LineProcessing\myfile.txt >H:\BatchTest\LineProcessing\result.txt
pause
exit
I always get the full file and it seems like regex is not even used. Can anybody point me into the right direction where i can search my mistake? i tried getting more information with this What are the undocumented features and limitations of the Windows FINDSTR command? post but i couldn't find my flaw or oversaw it.
Any help appreciated