title: Is there a way to extract specific character strings, multiple times, with grep / sed. Starts with an "("
body: <p>I am trying to extract all the station codes of a txt file. I converted this file from xml to .txt</p>
  
  <p>Here is an example of the text I am trying to extract from.</p>
  
  <pre><code>&lt;tr bgcolor="#F2F9FF"&gt;&lt;td headers="Station Name"&gt;&lt;a href="display.php?stid=KMLJ"&gt;Milledgeville, Baldwin County Airport&lt;/a&gt; (KMLJ)&lt;/td&gt;
  &lt;td headers="rss"&gt;&lt;div align="center"&gt;&lt;a href="KMLJ.rss"&gt;&lt;img src="/images/rss.jpg" alt="RSS Format" width="36" height="14" border="0"&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td headers="xml"&gt;&lt;div align="center"&gt;&lt;a href="KMLJ.xml"&gt;&lt;img src="/images/xml.gif" alt="XML Format" width="36" height="14" border="0"&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;&lt;td headers="Station Name"&gt;&lt;a href="display.php?stid=K2J5"&gt;Millen Airport&lt;/a&gt; (K2J5)&lt;/td&gt;
  &lt;td headers="rss"&gt;&lt;div align="center"&gt;&lt;a href="K2J5.rss"&gt;&lt;img src="/images/rss.jpg" alt="RSS Format" width="36" height="14" border="0"&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td headers="xml"&gt;&lt;div align="center"&gt;&lt;a href="K2J5.xml"&gt;&lt;img src="/images/xml.gif" alt="XML Format" width="36" height="14" border="0"&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr bgcolor="#F2F9FF"&gt;&lt;td headers="Station Name"&gt;&lt;a href="display.php?stid=KD73"&gt;Monroe-Walton County Airport&lt;/a&gt; (KD73)&lt;/td&gt;
  &lt;td headers="rss"&gt;&lt;div align="center"&gt;&lt;a href="KD73.rss"&gt;&lt;img src="/images/rss.jpg" alt="RSS Format" width="36" height="14" border="0"&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td headers="xml"&gt;&lt;div align="center"&gt;&lt;a href="KD73.xml"&gt;&lt;img src="/images/xml.gif" alt="XML Format" width="36" height="14" border="0"&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt; 
  </code></pre>
  
  <p>I have tried grep and sed. </p>
  
  <pre><code> sed -n '(k' stations.txt 
  </code></pre>
  
  <p>I want to export either to a csv or a textfile with just the desired string, i.e. (KMLJ) (K2J5) (KD73)</p>