title: How to add or import multiple items to a file which saved in Documents Directory with Swift?
body: <p>As you can see, here is how to add a word "hello" to a <code>Test.txt</code> (saved in <code>Documents Directory</code> of an app):</p>
  
  <pre><code>let documentsDirectory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!
  
  let archiveURL = documentsDirectory.appendingPathComponent("Test").appendingPathExtension("txt")
  
  try! Data("hello".utf8).write(to: archiveURL)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/D0MKX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/D0MKX.png" alt="Picture1"></a></p>
  
  <p>Suppose I have a txt or csv file (with 300 names saved one by one in line: Picture1), which is saved in iCloud Drive or somewhere. How can I add those names to the Test.txt file (saved in <code>Documents Directory</code> of an app) with one time, just the following gif shows (Picture 2). Any suggestions would be appreciated.</p>
  
  <p><a href="https://i.stack.imgur.com/iFW5o.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iFW5o.gif" alt="Picture 2"></a></p>