Skip to content

Commit

Permalink
Update concatenateDats.m
Browse files Browse the repository at this point in the history
concatenateDats.m requires subfolder ends with HHmmss, this creates issue for datalogger file system that includes milliseconds.

Solution: used regexpi to find last 6 consecutive digits instead.
  • Loading branch information
zifangzhao committed Jan 11, 2025
1 parent 49184ec commit 3d33dc9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion preProcessing/concatenateDats.m
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ function concatenateDats(basepath, sortFiles, legacy)
%% Sort files according to time of recording

if sortFiles
names2sort = cellfun(@(X) str2num(X(end-5:end)), recordingnames, 'UniformOutput', false);
names2sort = cellfun(@(x) regexpi(x,'(?<=_)\d{6}','match'),recordingnames,'UniformOutput', false);
names2sort= cellfun(@(x) str2num(x{end}),names2sort,'uni',0);
names2sort = cell2mat(names2sort);
if ~isempty(names2sort)
disp('Assuming the last 6 digits reflect recording time.')
Expand Down

0 comments on commit 3d33dc9

Please sign in to comment.