function fixFilterFlag
folder = 'z:/balch lab/uw data/';
cd (folder)
subfolders = dir('2020-*');
for ix = 1:numel(subfolders)
    if subfolders(ix).isdir
        thisFolder = subfolders(ix).name;
        cd (thisFolder)
        disp (thisFolder)
        rawFiles = dir('*.raw');
        for iy = 1:numel(rawFiles)
            thisFile = rawFiles(iy).name;
            if ~exist(  [thisFile '.flowData.mat'],'file')
                disp(['   - ' thisFile])
                fileDate = rawFiles(iy).folder(end-9:end);
                dayNum = datenum(fileDate);
                fid = fopen(thisFile,'r');
                flow = 0;
                counter = 0;
                while ~feof(fid)
                    line = fgetl(fid);
                    if numel(strtrim(line)) > 3
                        switch line(1:3)
                            case 'GPS'
                                values = strsplit(strtrim(line));
                                gpsString = values{3};
                                gpsParts = strsplit(gpsString,',');
                                try
                                    time = gpsParts{2};
                                    time = time(1:6);
                                    time = datenum(time,'HHMMSS');
                                    time = time-fix(time);
                                    if time == 0
                                        dayNum = dayNum + 1;
                                        disp(gpsString)
                                    end
                                    time = dayNum + time;
                                    counter = counter + 1;
                                    flowTime(counter) = time;
                                    flowValue(counter) = flow;
                                    %                                     disp ([datestr(time,0) ' - ' num2str(flow)])
                                catch
                                end
                            case 'FLW'
                                values = strsplit(strtrim(line));
                                flow = str2double(values{4});
                        end
                    end
                end
                save ([thisFile '.flowData.mat'],'flowTime','flowValue')
            end
        end
        cd ('..')
    end
end
end