files=uipickfiles;
nfiles=length(files);
basedir='G:\projects\ccny-2020';
if ~isdir([basedir,'\Analysis'])
    mkdir([basedir,'\Analysis'])
end
for jfiles=1:nfiles
    jfiles
    [filedir,filenm]=fileparts(char(files(jfiles)));
    fid=fopen(char(files(jfiles)));
    lidar=read_CSM(fid,0.0);
    fclose(fid)
    ym=datestr(lidar.start_time,'yyyymm');
    ymd=datestr(lidar.start_time,'yyyymmdd');
    hms=datestr(lidar.start_time,'HHMMSS');
    savedir=[basedir,'\Analysis','\',ym,'\',ymd,'\'];
    if ~isdir(savedir)
        mkdir(savedir)
    end

  
    uname=[savedir,'User_',hms,'.mat']
    save(uname,'lidar')
    clear vvp profile fid
end