|Its still not working, editing in notepad|
rem Double quote file names if needed
rem you can specify a full path
rem "%newfile%" will be overwritten
copy nul %newfile% > nul
rem Use carets to escape characters if needed below
set str= ABC
for /f %%a in ('cmd /u /c set /p "=%str:"= %"^<nul ^| find /c /v "" ') do set len=%%a
for /f "delims=" %%a in (' find /v /n "" ^< %yourfile% ') do (
if defined line (
if "!line:~0,%len%!"=="!str!" (
>> !newfile! echo.!rep!
) else >> !newfile! echo !line!
) else >> !newfile! echo.
echo If you are prompted you will loose either the old or current
echo backup, you can manually back up before selecting
REM copy /-y %yourfile% "%yourfile:"=%.bak"
REM move %newfile% %yourfile%
If I remove the <tab> from both test.txt and the script it works just fine. If the <tab> is there it doesn't work. I have no idea what is wrong. Thanks for helping, I really appreciate it.