Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

write results into a text file

I created a batch that will use windows FINDSTR to search for my selective input.

I am trying to log my results of my search term in a text file called results.txt

So I do have something like this so results are kept not overwritten:

>>Results.txt 

I've created the txt file so it'll write to it, this is what I tried and won't work:

findstr "\<%X%\>" *.txt  
echo >>results.txt

That is what I have for trying to log my results of my search term, however nothing happens.

And when I have findstr "\<%X%>" *.txt >>results.txt

It tries to search for >>results.txt and it's not cooperating.

Anyone know what to do?

I'm doing this because FINDSTR will work in the cmd prompt but if I get too many results it cuts off the top, so I want it to write all the results into the results.txt so I can view the whole results with nothing cut off.

Thanks for the help =)

like image 882
Surfer Kyle Avatar asked Nov 15 '22 13:11

Surfer Kyle


1 Answers

Try using /c:

findstr /c:"<%X%>" *.txt >> results.txt

Edit: didn't need the ^ escaping here.

like image 155
i_am_jorf Avatar answered Nov 30 '22 22:11

i_am_jorf