Notifications
Clear all

[Closed] MemStream copy paste problem

Hi

i’m going to copy the content of a text file then paste in another file but i don’t want some part to get copied
here is my try

--create files	
  startfile = createFile "C://start_test.txt"
  Endfile = createFile "C://End_test.txt"
  --format some lines
  format "First line
Second line
Third line
Delete
Delete
Delete
" to:startfile
  close startfile
  close Endfile
  
  
  --try to copy the content
  mcop = MemStreamMgr.openFile "C://start_test.txt"
  data = ""
  while not mcop.eos() do data += mcop.readLine() + "
"
  MemStreamMgr.close ms
  --try to paste in Endfile
  expFile = openFile "C://End_test.txt" mode:"a+"
  format "%" data to:expFile
  close expFile; free expFile

Doing this, all the content of startfile get copied and pasted to the Endfile.
now i like to know how to NOT copy these delete lines i mean here the 4,5,6 lines and i can’t do any changes with the original file i mean startfile

i found ms.skipBlock “xxxx” “yyyy” which skip some lines but i don’t know how to use it when the line is not the first line

if it is not possible in this way any help is so appreciated
Thanks in advance