title: Add extra column to a list of .txt files based on keywords
body: <p>I have a list of 100 text files that have values of temperature belonging to each station in the UK. However, I have no way of distinguishing them in a loop besides by manual work.</p>
  <p>I wish for them to be detected by keywords, and then attribute a column vector by the selected name, for example:</p>
  <pre><code>EUROPEAN CLIMATE ASSESSMENT &amp; DATASET (ECA&amp;D), file created on 25-06-2021
  THESE DATA CAN BE USED FREELY PROVIDED THAT THE FOLLOWING SOURCE IS ACKNOWLEDGED:
  
  Klein Tank, A.M.G. and Coauthors, 2002. Daily dataset of 20th-century surface
  air temperature and precipitation series for the European Climate Assessment.
  Int. J. of Climatol., 22, 1441-1453.
  Data and metadata available at http://www.ecad.eu
  
  FILE FORMAT (MISSING VALUE CODE IS -9999):
  
  01-06 SOUID: Source identifier
  08-15 DATE : Date YYYYMMDD
  17-21 TX   : maximum temperature in 0.1 &amp;#176;C
  23-27 Q_TX : Quality code for TX (0='valid'; 1='suspect'; 9='missing')
  
  This is the blended series of station UNITED KINGDOM, ARMAGH (STAID: 271).
  Blended and updated with sources: 100918 146805 
  See file sources.txt and stations.txt for more info.
  
  SOUID,    DATE,   TX, Q_TX
  146805,18440101,   19,    0
  146805,18440102,   -2,    0
  146805,18440103,   67,    0
  146805,18440104,  111,    0
  146805,18440105,  117,    0
  146805,18440106,   89,    0
  146805,18440107,   61,    0
  146805,18440108,   69,    0
  
  #Expected:
  SOUID,    DATE,   TX, Q_TX    Station
  146805,18440101,   19,    0   ARMAGH
  146805,18440102,   -2,    0   ARMAGH
  146805,18440103,   67,    0   ARMAGH
  146805,18440104,  111,    0   ARMAGH
  146805,18440105,  117,    0   ARMAGH
  146805,18440106,   89,    0   ARMAGH
  146805,18440107,   61,    0   ARMAGH 
  146805,18440108,   69,    0   ARMAGH
  
  </code></pre>
  <p>I can select the list of files using:</p>
  <pre><code>files &lt;- list.files(pattern = &quot;.txt&quot;, full.names=TRUE)
  all.txt &lt;- lapply(files, data.table::fread)
  </code></pre>
  <p>However, <code>fread</code> removes the header so I have no way of identifying which Station they belong to.</p>
  <p>How can I create a new column based on the station in the text, if I have a list of station names available tat I can match them to?</p>
  <p>Update:</p>
  <p>I have managed to read the text file into <code>read_table</code>, then extract the stations names that come after Kingdom, however those names with white spaces, only the first word is select. Given that that the station name is at the end of the row after United Kingdom, then selecting the rest of the words after KINGDOM would work.</p>
  <p>Here is what I tried so far:</p>
  <pre><code>stringr::str_extract(xp1$xp, '(?&lt;=KINGDOM\\s)\\w+')
  </code></pre>
  <p>Which would fail if I had e.g. <code>Cex et England</code>, I only get <code>Cex</code></p>