function tempfile

clc
batchresultsfile = 'F:\ResultsViewer\batchresults.txt ';
curdir = fileparts(batchresultsfile);

batchresults = load(batchresultsfile);

%Table 
year = 2006;
transectIDs = [3300 3775 6625 8175 8700 9975 10623];
probability = [0.01 0.002 0.001 0.00025 0.0001 0.000025 0.00001];
results  = filterBatchresults(batchresults,1,'value',year,'relop','>',12);
%for i = 1:length(transectIDs)
%    for j = 1:length(probability)
%        results  =
%        filterBatchresults(batchresults,1,year,3,transectIDs(i),17,probability(j));
%        table(j,i)=results(1,11);
%    end
%end

%Kijkduin
name = 'Kijkduin';
disp(['Processing ' name ' ...'])
year = 2006;
areacode = 9;
transectIDs = [10547 10567 10592 10623 10653 10683];
probability = [0.00001 0.000025 0.0001 0.00025 0.001 0.002 0.01];
for i = 1 : length(probability)
    filename = [name ' ' num2str(year) ' - ' strrep(num2str(probability(i)),'.','_')];
    clear results
    results  = filterBatchresults(batchresults,1,year,2,areacode,3,transectIDs,17,probability(i));
    writeResults(results,[curdir filesep filename],1) % 1: points, 2: lines
    writeResults(results,[curdir filesep filename],2) % 1: points, 2: lines
end

% Scheveningen
name = 'Scheveningen';
disp(['Processing ' name ' ...'])
year = 2006;
areacode = 9;
transectIDs = [9795 9830 9875 9925 9975 10025 10075 10125 10140 10200 10217 10235];
probability = [0.00001 0.000025 0.0001 0.00025 0.001 0.002 0.01];
for i = 1 : length(probability)
    filename = [name ' ' num2str(year) ' - ' strrep(num2str(probability(i)),'.','_')];
    clear results
    results  = filterBatchresults(batchresults,1,year,2,areacode,3,transectIDs,17,probability(i));
    writeResults(results,[curdir filesep filename],1) % 1: points, 2: lines
    writeResults(results,[curdir filesep filename],2) % 1: points, 2: lines
end

%Katwijk 8575 t/m 8850 (12 in totaal)
name = 'Katwijk';
disp(['Processing ' name ' ...'])
year = 2006;
areacode = 8;
transectIDs = [8575:8850];
probability = [0.00001 0.000025 0.0001 0.00025 0.001 0.002 0.01];
for i = 1 : length(probability)
    filename = [name ' ' num2str(year) ' - ' strrep(num2str(probability(i)),'.','_')];
    clear results
    results  = filterBatchresults(batchresults,1,year,2,areacode,3,transectIDs,17,probability(i));
    writeResults(results,[curdir filesep filename],1) % 1: points, 2: lines
    writeResults(results,[curdir filesep filename],2) % 1: points, 2: lines
end

%Noordwijk 8025 t/m 8375 (15 in totaal)
name = 'Noordwijk';
disp(['Processing ' name ' ...'])
year = 2006;
areacode = 8;
transectIDs = [8025:8375];
probability = [0.00001 0.000025 0.0001 0.00025 0.001 0.002 0.01];
for i = 1 : length(probability)
    filename = [name ' ' num2str(year) ' - ' strrep(num2str(probability(i)),'.','_')];
    clear results
    results  = filterBatchresults(batchresults,1,year,2,areacode,3,transectIDs,17,probability(i));
    writeResults(results,[curdir filesep filename],1) % 1: points, 2: lines
    writeResults(results,[curdir filesep filename],2) % 1: points, 2: lines
end

%Zandvoort 6425 t/m 6775 (15 in totaal)
name = 'Zandvoort';
disp(['Processing ' name ' ...'])
year = 2006;
areacode = 8;
transectIDs = [6425:6775];
probability = [0.00001 0.000025 0.0001 0.00025 0.001 0.002 0.01];
for i = 1 : length(probability)
    filename = [name ' ' num2str(year) ' - ' strrep(num2str(probability(i)),'.','_')];
    clear results
    results  = filterBatchresults(batchresults,1,year,2,areacode,3,transectIDs,17,probability(i));
    writeResults(results,[curdir filesep filename],1) % 1: points, 2: lines
    writeResults(results,[curdir filesep filename],2) % 1: points, 2: lines
end

%Egmond 3700 t/m 3900 (9 in totaal)
name = 'Egmond';
disp(['Processing ' name ' ...'])
year = 2006;
areacode = 7;
transectIDs = [3700:3900];
probability = [0.00001 0.000025 0.0001 0.00025 0.001 0.002 0.01];
for i = 1 : length(probability)
    filename = [name ' ' num2str(year) ' - ' strrep(num2str(probability(i)),'.','_')];
    clear results
    results  = filterBatchresults(batchresults,1,year,2,areacode,3,transectIDs,17,probability(i));
    writeResults(results,[curdir filesep filename],1) % 1: points, 2: lines
    writeResults(results,[curdir filesep filename],2) % 1: points, 2: lines
end

%Bergen 3225 t/m 3400 (8 in totaal)
name = 'Bergen';
disp(['Processing ' name ' ...'])
year = 2006;
areacode = 7;
transectIDs = [3225:3400];
probability = [0.00001 0.000025 0.0001 0.00025 0.001 0.002 0.01];
for i = 1 : length(probability)
    filename = [name ' ' num2str(year) ' - ' strrep(num2str(probability(i)),'.','_')];
    clear results
    results  = filterBatchresults(batchresults,1,year,2,areacode,3,transectIDs,17,probability(i));
    writeResults(results,[curdir filesep filename],1) % 1: points, 2: lines
    writeResults(results,[curdir filesep filename],2) % 1: points, 2: lines
end





