I had one piece code which used sed in batch file. Now due to sed is not a native utilities in windows. When I implement my code in Windows server 2012 R2, I got this issue:
'sed' is not recognized as an internal or external command.
I know there is two options:
either I install sed utility in server 2012 R2, I need to find it out
or change the following code to pure batch file
Could you please help me on the second option if possible?
Only read first and second lines from an old file which must have more then two lines then output into a new file...
Code: Select all
@ECHO OFF
cd C:\auto_pkg_build\Scripts\scheme_replace\pkg_data\temp
if exist newdata_1.txt (del newdata_1.txt)
sed -n -e 1p -e 2p echo_data_1.txt > newdata_1.txt