title: Python statement merge
body: <p>I have a standard format letter(in txt format) and within it I want to replace some words(keywords) with the words I have created in a separate wordlist.</p>
  <p>to visualise my letter is:</p>
  <pre><code>Dear [name],
   
  I have b-day party on [date] at [venue]
  please be there @ [time]
   
  Sincerely,
  </code></pre>
  <p>the following is the file that I would like to replace:</p>
  <pre><code>Mary
  12.02.2022
  Soho House
  08.00pm
  </code></pre>
  <p>so Mary would be seen on the [name] and 12.02.2022 is seen on the [date] such as:</p>
  <p>Dear Mary,
  I have a b-day party on 12.02.2022 xxxx</p>
  <p>Following code didnot work. Could you please support how to solve this issue?</p>
  <pre><code>import keyword
   
  placeholder1=&quot;[name]&quot;
  placeholder2=&quot;[date]&quot;
  placeholder3=&quot;[venue]&quot;
  placeholder4=&quot;[time]&quot;
   
   
  with open(&quot;occurence.txt&quot;) as letter:
      keyref=letter.readlines()
   
   
  with open(&quot;sample_letter.txt&quot;) as target:
      target_contents=target.read()
   
   
   
  for name in keyref:
      word1=target_contents.replace(placeholder1,name)
   
   
  for date in keyref:
      word2 = target_contents.replace(placeholder2, date)
   
   
  print(word1)
  print(word2)
  </code></pre>