%%% Inputfile
fname=['XYZjetskiRD2009_05_20.dat'];
fid=fopen(fname,'r');

data = [];

tline = fgetl(fid); tline = fgetl(fid); tline = fgetl(fid);

while 1
    tline = fgetl(fid);
    if ~ischar(tline),   break,   end
        tline = strrep(tline, ',', '.');
 [ a b c ] = strread(tline, '%s %s %s', 'delimiter', '  ');      
 data=[data; str2num(a{1,1}(1,:)) str2num(b{1,1}(1,:)) str2num(c{1,1}(1,:))];
 %         disp(tline);
end

fclose(fid);

XYZ_RD=data

figure
scatter3(XYZ_RD(:,1),XYZ_RD(:,2),XYZ_RD(:,3))

%%%% 

%%%%% Savedata!
curdir = cd;
cd('..');
locdir = cd;
cd(curdir);

filenameXYZ=(['XYZ_RD' curdir(1,length(locdir)+2:end) '.mat']);
save(filenameXYZ,'XYZ_RD');

