0
@echo off 
    setlocal enableextensions disabledelayedexpansion
 for /r %f in (xis_*) do  More +1 %~nxf >> No_header_%~nxf
    set "search=:20:"
    set "replace={:20:"
    for /f "delims=" %%i in ('type (No_header*.txt) ^& break ^> (No_header_*.txt) ') do (
        set "line=%%i"
        setlocal enabledelayedexpansion
        set "line=!line:%search%=%replace%!"
        >>No_header*.txt echo(!line!
        endlocal
    )

I am trying to skip the header line in a text file and replace :20: with {:20:. I have written and have almost achieved my goal.

0

Use a counter to figure out which line you are on, and then perform your actions based on that.

Something like:

SET /A MYCOUNT=0

for ... do (
  SET /A MYCOUNT+=1
  IF %MYCOUNT% GTR 1 (
    ' Do stuff  
  )
)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.