[Gambas-user] help with some simple parsing

richard terry rterry at ...1946...
Wed May 6 15:01:45 CEST 2009


See the attached file for the data. Unfortunately I'm brain dead when it comes 
to simple logic.

In one of my hl7 messages in the Free Text segment under an actual pathology 
result, there is a list of sequential bood test results representing previous 
results of the same type - , separated by tabs which I need to display 
properly. as I've re-constructed the result as html, the tabs simply 
disappear in the result, so I've been looking for a solution, and to start I 
thought maybe I could split this up into lines and then later put it into a 
table embedded in the html to keep it aligned.

Perhaps there is a simple way out, but this is what I've done so far.


So I started with this:

1) Split this into lines

Dim bits as string[]
dim a_line as string

bits = split(the_text_in_the_file,"<BR>,"", TRUE)

for each a_line in bits
	print a_line
next	

Problem with this is that the \t (I presume tab character) gets in the way, 
and it dosn't split properly with the results of the bits[] as shown in the 
picture. Interestingly an occasional letter is lost off the test names.

Any help appreciated.

richard



-------------- next part --------------

05-Jan-09   21-Oct-08   25-Aug-08   30-Jun-08<BR>	Sodium                          142         136         143         140<BR>	Potassium                       3.7         3.8         4.5         4.0<BR>	Chloride                        103         100         104         103<BR>	Bicarb.                          31  H       29          33  H       29<BR>	Urea                            4.5         3.9         4.4         4.7<BR>	Creatinine                       73          59  L       68          60  L<BR>	GFR Est.                         69          89          75          87<BR>	Anion Gap                        12          11          11          13<BR>	Calcium                                    2.22        2.33        2.28<BR>	Calc.IonCa                                 1.09        1.11        1.10<BR>	T.Protein                        67          69          65          66<BR>	Albumin                          38          37          40          40<BR>	Calc.Glob.                       30          32          25  L       26  L<BR>	Total Bilirubin                   4           6           4           5<BR>	GGT                              18          25          24          19<BR>	Alk.Phos.                        90          74          82          70<BR>	ALT                              40  H       33          30          26<BR>	AST                              32  H       26          22          18<BR>	LD                              232         188         270  H      173<BR>	Glucose
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bits.png
Type: image/png
Size: 42656 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20090506/003eee62/attachment.png>


More information about the User mailing list