title: Split file every n lines
body: <p>I’m working with the royal mail PAF database in csv format (approx 29 million lines), and need to split the data into files of approx 1000 lines.</p>
  
  <p>I found <a href="https://stackoverflow.com/a/8366573/2472672">this solution</a> to write the files, but do not know how to a. open the file, and b. tell the script to delete the lines from the original file after copying them.</p>
  
  <p>Can anyone advise?</p>