function [output]=SortLoadedData2(inputcell, sorted_FilenameExportmat)
output=cell(size(sorted_FilenameExportmat,1),1);
for k=1:size(sorted_FilenameExportmat,1)
    strqry=cell2mat(sorted_FilenameExportmat(k,1));
    strqry=strqry(1,1:30);
    running=0;
    for k2=1:size(inputcell,2)
        findstr=cell2mat(inputcell(1,k2));
        findstr=findstr(1,1:30);
        if strcmp(strqry,findstr)
            running=running+1;
            output(k)=inputcell(k2);
        end
        if running>1 % too many matches found
            FORCEDERROR
        end
    end %k2 end
    if running==0 %no match found
        FORCEDERROR
    end
end %k end
end %function end