<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>Regular Expression help</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial">Hi </FONT></SPAN>
</P>

<P><SPAN LANG="en-gb"><FONT SIZE=2 FACE="Arial">I have a text file that I would like to split up so that I can use it in Excel to filter a certain field. However as it is a flat text file I need to do some processing on it so that Excel can correctly import it.</FONT></SPAN></P>

<P><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Arial">File Example:</FONT></SPAN>

<BR><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Arial">tag &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; desc&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VM</FONT></SPAN>

<BR><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Arial">(0012,0042) Clinical Trial Subject Reading ID LO 1 </FONT></SPAN>

<BR><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Arial">(0012,0050) Clinical Trial Time Point ID LO 1 </FONT></SPAN>

<BR><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Arial">(0012,0051) Clinical Trial Time Point Description ST 1 </FONT></SPAN>

<BR><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Arial">(0012,0060) Clinical Trial Coordinating Center Name LO 1 </FONT></SPAN>

<BR><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Arial">(0018,0010) Contrast/Bolus Agent LO 1 </FONT></SPAN>

<BR><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Arial">(0018,0012) Contrast/Bolus Agent Sequence SQ 1 </FONT></SPAN>

<BR><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Arial">(0018,0014) Contrast/Bolus Administration Route Sequence SQ 1 </FONT></SPAN>

<BR><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Arial">(0018,0015) Body Part Examined CS 1 </FONT></SPAN>
</P>

<P><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Arial">What I essentially want is to use python to process this file to give me </FONT></SPAN>
</P>
<BR>

<P><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Arial">(0012,0042); Clinical Trial Subject Reading ID; LO; 1 </FONT></SPAN>

<BR><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Arial">(0012,0050); Clinical Trial Time Point ID; LO; 1 </FONT></SPAN>

<BR><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Arial">(0012,0051); Clinical Trial Time Point Description; ST; 1 </FONT></SPAN>

<BR><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Arial">(0012,0060); Clinical Trial Coordinating Center Name; LO; 1 </FONT></SPAN>

<BR><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Arial">(0018,0010); Contrast/Bolus Agent; LO; 1 </FONT></SPAN>

<BR><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Arial">(0018,0012); Contrast/Bolus Agent Sequence; SQ ;1 </FONT></SPAN>

<BR><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Arial">(0018,0014); Contrast/Bolus Administration Route Sequence; SQ; 1 </FONT></SPAN>

<BR><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Arial">(0018,0015); Body Part Examined; CS; 1 </FONT></SPAN>
</P>

<P><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Arial">so that I can import to excel using a delimiter. </FONT></SPAN>
</P>

<P><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Arial">This file is extremely long and all I essentially want to do is to break it into it 'fields'</FONT></SPAN>
</P>

<P><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Arial">Now I suspect that regular expressions are the way to go but I have only basic experience of using these and I have no idea what I should be doing.</FONT></SPAN></P>

<P><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Arial">Can anyone help.</FONT></SPAN>
</P>

<P><SPAN LANG="en-nz"><FONT SIZE=2 FACE="Arial">Thanks</FONT></SPAN>
</P>
<BR>

<p></p><p>DISCLAIMER:<br>Unless indicated otherwise, the information contained in this message is privileged and confidential, and is intended only for the use of the addressee(s) named above and others who have been specifically authorized to receive it. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message and/or attachments is strictly prohibited. The company accepts no liability for any damage caused by any virus transmitted by this email. Furthermore, the company does not warrant a proper and complete transmission of this information, nor does it accept liability for any delays. If you have received this message in error, please contact the sender and delete the message. Thank you.</BODY>
</HTML>