These positions can then be used when restoring the database of MySQL when you want to skip some commands. These lines are also important because they contain the position of the search string and the future planned for her in the binary log. #150918 10:51:09 server id 1 end_log_pos 6679 CRC32 0x22af3729 QueryĭROP TABLE `mysalers` /* generated by server */Īs a result, we obtain the desired command to delete a table `mysalers` and 3 lines going to it. Mysqlbinlog -database=sale "c\:MySQL\data\mysql-bin.000001" > "d:\binlog.txt" | d:\findrow.bat "d:\binlog.txt" "DROP TABLE `mysalers`" -3 Need to find a command ‘DROP TABLE `mysalers`’ in the binary log mysql-bin.000001: Let’s look at a more complex case, for example, the search string in the binary log of server MySQL. %3 - include additional lines to (example, -3) or after (example, 3) search string %1 - file in which you want to search a string You can find all documents that contain a word or sentence you’re looking for. Rem displays the search string (and additional)įor /f "usebackq delims=" %%x in (`find /n /v "" %infile% ^| find ""`) do (set value=%%x)įile creation «findrow.bat» has three input parameters that must always be asked: findrow.bat %1 %2 %3 In Windows 7, there is a feature that lets you search documents for text within them. After completion, the results will be displayed on the interface. Windows Grep will begin searching the specified folder and files for the specified text string.
you can even specify your own custom file types to search for the text string. Rem offset - include additional lines to (example, -3) or after (example, 3) search stringįor /F "delims=:" %%i in ('findstr /N /I /C:%searchstring% %infile%') do (set par=%%i) Then, click Next and specify the file types to search. Rem infile - file in which you want to search a string Create batch-file with name «findrow.bat» and save the following off