Incidentally, readLine() will return a
String that does not include any line terminators (\n or \r). So when you write the record to a new file, you probably want to add new line terminators too. This is typically achieved by using a PrintWriter, which has a println() method which uses your platform's default line terminator.