Newbie question.

From: Piotr Borowski (borowski_at_uhc.com.pl)
Date: 03/30/04


Date: Tue, 30 Mar 2004 11:25:12 +0200

Hello,

I wanted to write a simple script that would parse data from a to b.

a.
-TypDok-Wersja-PIMW-
5 6 -1
b.
TypDok;Wersja;PIMW;
5;6;-1;

I cut off first characters of each line:

[string trim "-"]
[string trim " "]

And then used split and join functions to get requested list.

set posplicie [split $poobcieciu "-"]
set podolaczeniu [join $posplicie ";"]

Eventually I got empty list elements. And my parsing looks like:

TypDok;Wersja;PIMW;
5;;;;;;6;;;;;;-1;

Is there any way to get rid of that empty elements?

Regards,

Piotr Borowski