Trying to find line in a file but an having an issue with the literal search string. When search for a string it is returning multiple line that where the search string is only part of the line. As an example, I am looking up comp1 in a list of computers and i am getting comp1 and comp1a being returned. Is there a way to just return the first and not the second, or is this a limitation of findstr. Code below
For /f %%a in (%home%\text.txt) do call :look1 %%a
:look1
set lookup=%1
findstr /i /c:%lookup% %home%\data.csv >> %home%\final.csv
exit /b
Edited to include sample of data.csv
Data.csv
date,comp,os,application
date,comp1,os,application
date,comp1a,os,application
date,comp2,os,application