convert non-delimited to delimited

John kuchunwah01 at yahoo.com
Thu Aug 6 11:19:20 EDT 2009


I am not really a CS person, but I have a task to import a non-delimited text to an access database.  After some research, I *think* the best way to do this is by first converting the non-delimited text to delimited text, and then import it to the database.  Is this the best way to approach this?  Or is there easier way?

Example:
---------------------------------------------------------------------------
Test , BTS
0800000532
05/MAY/1945 00:00
Female
858327
AB Pos
�
<START_TR>
CMV Neg Req'd
IgA Deficient
<STOP_TR>
<START_AB>
<STOP_AB>
<START_AG>
Wr(a+)
S-
<STOP_AG>
<START_COM>
>> OCT/23/07 08:18:00 TRETHEWEYD >>>>>>>>>>>>>>>>> Please fax to:
>> OCT/22/07 09:37:00 [COMBINE] [Combine from person_id 924598 to person_id 858327]
[Following comments for to person_id 924598]
>> OCT/18/07 15:53:00 TRETHEWEYD 2007/10/18 15:52
<STOP_COM>
-----------------------------------------------------------------------------------
Basically there are 2 portions to this.  The first portion consist of 7 lines (Full Name, Medical record number, birth date, gender, internal ID, blood group, phenotype).  The second portion list the different list of requirements, denote by <start> and <stop>.  In the sample shown above, the patient do not have information on phenotype, thus there is the � symbol.  
 
I am really stump on where to go from here.  Any help would be appreciated it.  I have also include a text file which gives several more examples.
 
Thanks so much!


      __________________________________________________________________
Looking for the perfect gift? Give the gift of Flickr! 

http://www.flickr.com/gift/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090806/f5bba911/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: samplepatient.txt
Type: application/octet-stream
Size: 48996 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20090806/f5bba911/attachment.obj>


More information about the Python-list mailing list