computing
  • 0

Remove Duplicate Lines From My Text File Using .bat File

  • 0

now i want to remove two instances of line “This is me” and retain just one line. please suggest how should i do it using .bat file

Thanks
Rahul

Share

1 Answer

  1. :: ===== script starts here ===============
    :: no dups
    :: rahul.bat Tue 05-06-2012 9:20:52.14
    @echo off > newfile & setLocal enableDELAYedeXpansioN

    for /f “tokens=* delims= ” %%a in (myfile) do (
    find “%%a” < newfile > nul || >> newfile echo.%%a
    )
    ::====== script ends here =================

    =====================================
    Life is too important to be taken seriously.

    M2

    • 0