My batch file writes a list of files on screen where it contains the .cs extension
for /F "usebackq delims=" %%A in (`cleartool ls -rec ^| find /V "Rule:" ^| find /V "hijacked" ^| find /V "eclipsed" ^| find /V "-->"`) do (
if "%%~xA"==".cs" echo %%A
)
This works fine. I want to enhance the functionality by adding another condition. I want to remove a certain word if it exists in the phrase. The word is obj
Examples of my results are
myThing\obj\this.cs
obj\other\that\this.cs
debug\this\that.cs
I tried
for /F "usebackq delims=" %%A in (`cleartool ls -rec ^| find /V "Rule:" ^| find /V "hijacked" ^| find /V "eclipsed" ^| find /V "-->"`) do (
if "%%~xA"==".cs" if NOT "%%A"=="*obj*" echo %%A
)
but this doesn't change the results compared to the first.
I think my if syntax is correct, and the issue is actually with the "%%A"=="*obj*"