Under Windows XP, if you want to copy all the text content after the third line of 1.txt to a specified text file, how can you achieve it?
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
sed -n "3,$p" 1.txt >temp.txt
with CreateObject("SAFRCFileDlg.Fileopen")
.openfileopendlg
if not len(trim(.filename)) = 0 then
oldfilename = .filename
else
msgbox "No file selected!"
wscript.quit
end if
end with
newfilename = left(oldfilename,len(oldfilename) - 4) & "cxs" & right(oldfilename,4)
number1 = inputbox("Enter the starting line number:")
number2 = inputbox("Enter the number of lines:")
with createobject("scripting.filesystemobject")
set rfile = .opentextfile(oldfilename,1,true)
set wfile = .opentextfile(newfilename,2,true)
for i = 1 to number1
rfile.skipline
next
for j = 1 to number2
str = rfile.readline
wfile.writeline str
next
end with