How to copy specific data out of a file using python?
<p>I have some large data files and I want to copy out certain pieces of data on each line, basically an ID code. The ID code has a <code>|</code> on one side and a space on the other. I was wondering would it be possible to pull out just the ID. Also I have two data files, one has 4 ID codes per line and the other has 23 per line.</p>

<p>At the moment I'm thinking something like copying each line from the data file, then subtract the strings from each other to get the desired ID code, but surely there must be an easier way! Help?</p>

<p>Here is an example of a line from the data file that I'm working with</p>

<pre><code>cluster8032:  WoodR1|Wood_4286 Q8R1|EIK58010 F113|AEV64487.1 NFM421|PSEBR_a4327
</code></pre>

<p>and from this line I would want to output on separate lines</p>

<pre><code>Wood_4286
EIK58010
AEV644870.1
PSEBR_a4327
</code></pre>
