Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- setlocal enabledelayedexpansion
- for /f "delims=:" %%a in ('findstr /n "AXX0000XXXA" "data.txt"') do (set find_line=%%a)
- set /a counter=0
- for /f "usebackq delims=" %%b in (`"findstr /n ^^ data.txt"`) do (
- set curr_line=%%b
- set /a counter=!counter!+1
- if !counter! equ !find_line! (
- type temp.txt >> target.txt
- )
- call :print_line curr_line
- )
- endlocal
- :print_line
- setlocal enabledelayedexpansion
- set line=!%1!
- set line=!line:*:=!
- echo !line!>>target.txt
- endlocal
Add Comment
Please, Sign In to add comment