Well, Dexie, try this:
PROCEDURE ImportDTMData; { ? Petri Sakkinen 2009 }
CONST
comma = ',';
VAR
data, inputfile : STRING;
x, y, z : REAL;
commaPos : INTEGER;
BEGIN
GETFILE(inputfile);
IF NOT(DIDCANCEL) THEN BEGIN
WHILE NOT EOF(inputfile) DO BEGIN
READLN(data);
commaPos := POS(comma, data);
x := STR2NUM(COPY(data, 1, commaPos-1));
DELETE(data, 1, commaPos);
commaPos := POS(comma, data);
y := STR2NUM(COPY(data, 1, commaPos-1));
DELETE(data, 1, commaPos);
z := STR2NUM(data);
LOCUS3D(x, y, z);
END;
CLOSE(inputfile);
END;
END;
RUN(ImportDTMData);
If it is slow, you might use a text editor to replace commas with tabs and then use this:
PROCEDURE ImportDTMData; { ? Petri Sakkinen 2009 }
VAR
inputfile : STRING;
x, y, z : REAL;
BEGIN
GETFILE(inputfile);
IF NOT(DIDCANCEL) THEN BEGIN
WHILE NOT EOF(inputfile) DO BEGIN
READLN(x, y, z);
LOCUS3D(x, y, z);
END;
CLOSE(inputfile);
END;
END;
RUN(ImportDTMData);
Tab-separated data files are preferred.
For filtering/reducing number of points, add a READLN; after LOCUS3D(); so every second line is skipped. (The last point is not created then, though, but doing that manually is not a huge task!)
EDIT
Actually, the extra READLN; could be before the actual READLN(); because then you don't need to go to the end of the file to find the z-value!