[Gambas-user] help with some simple parsing

Emil Tchekov emil at ...1913...
Wed May 6 15:47:40 CEST 2009


You can use Replace$ to search and remove the "\t" character in your string.

I am not so fluent in Gambas, but the good old VB6 does support "" (null
string) as replacement, so I suppose that Gambas also do this.

Just put your "a_line" there and search for any "\t", replace with "" (null
string)...

Your text will get cleared

...


Other point of mention:

It will may be better to split also the "a_line" on the TAB char and thus
receive "semi"-two dimensional array containing your values. Then you can
start (re-)creating / displaying your data properly.



kind regards


Emil


P.S. Are you physician?





-----Ursprungliche Nachricht-----
Von: richard terry [mailto:rterry at ...1946...]
Gesendet: Mittwoch, 6. Mai 2009 15:02
An: mailing list for gambas users; Ian Haywood
Betreff: [Gambas-user] help with some simple parsing


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








More information about the User mailing list