I am trying to find the line (or lines, in this case there is only one possible result) containing this expression tableName_tOracleOutput_1 = "
in a .java file. I'm using the command
findstr "tableName_tOracleOutput_. ^= /"" dt_dea_kaspersky.java
directly on the cmd.exe
but the output is not what I expect, as you can see:
C:\Users\miguilem\Desktop\test_folder>findstr "tableName_tOracleOutput_. ^= /"" dt_dea_kaspersky.java
String tableName_tOracleOutput_1 = null;
tableName_tOracleOutput_1 = "dt_dea_kaspersky";
tableName_tOracleOutput_1 = dbschema_tOracleOutput_1 + "."
+ tableName_tOracleOutput_1
"mo_dwh/dt_dea_kaspersky_0_1/contexts/"
This result would be nearly the same as if I omitted the double quotes at the end of the expressions (giving me results I don t really need, i just want the line that contains the double quotes after the equals and a space). This is the result of the command with omitted doublequotes that (obviously) does not grant me the single result I want
C:\Users\miguilem\Desktop\test_folder>findstr "tableName_tOracleOutput_. ^= " dt_dea_kaspersky.java
String tableName_tOracleOutput_1 = null;
tableName_tOracleOutput_1 = "dt_dea_kaspersky";
tableName_tOracleOutput_1 = dbschema_tOracleOutput_1 + "."
+ tableName_tOracleOutput_1
(note the inconsistency of the two outputs, apparently the escaped doublequotes does not get completely ignored, they apparently cause a random additional ghost line STRAIGHT OUTTA NOWHERE, this line (mo_dwh/dt_dea_kaspersky_0_1/contexts/) is not even present in the code nor in a filename anywhere on the whole file system) I checked the newline characters with notepad++ and it looks as expected (standard CR|LF).
Besides the completely useless official documentation (which literally asks the user to go read about it somewhere else on a not linked command line guide) I checked for information here:
- Escaping Double Quotes in Batch Script
- http://www.robvanderwoude.com/findstr.php
- https://ss64.com/nt/findstr.html
- http://www.robvanderwoude.com/escapechars.php
At this point I think I missed something very basic, if you need any other information to replicate or solve the problem, don't hesitate to ask! Thanks.