Update - Add function to process a file and save computations in an Association
Any other required computations can be added to the function and the association.
processFile[file_] :=
Module[{data, selectedData, dataByDate, dataValues, datePlot,
datePlotMax, datePlotMin, datePlotMean, combinedDatePlot},
data = Import[file, "Table", "FieldSeparators" -> ";"][[2 ;;, -2 ;;]];
selectedData =
data // Select[(h = ToExpression@StringTake[First@#, 12 ;; 13]; h >= 10 && h <= 17) &];
dataByDate =
data //
GroupBy[StringTake[First@#, 10] & -> Last] //
Select[Length@# == 144 &] // (* Remove incomplete data *)
KeyMap[DateObject[{#, {"Day", "Month", "Year"}}] &];
dataValues = dataByDate // Values;
datePlot =
dataValues //
ListPlot[#, DataRange -> {0, 24}, ImageSize -> Medium,
PlotTheme -> "Detailed", PlotLabels -> None] &;
datePlotMax =
dataValues // Transpose // Map[Max] //
ListPlot[#, DataRange -> {0, 24}, ImageSize -> Medium,
PlotTheme -> "Detailed", Joined -> True, PlotStyle -> Red,
PlotLabels -> "Max"] &;
datePlotMin =
dataValues // Transpose // Map[Min] //
ListPlot[#, DataRange -> {0, 24}, ImageSize -> Medium,
PlotTheme -> "Detailed", Joined -> True, PlotStyle -> Green,
PlotLabels -> "Min"] &;
datePlotMean =
dataValues // Transpose // Map[Mean] //
ListPlot[#, DataRange -> {0, 24}, ImageSize -> Medium,
PlotTheme -> "Detailed", Joined -> True, PlotStyle -> Blue,
PlotLabels -> "Mean"] &;
combinedDatePlot =
Show[datePlotMax, datePlotMin, datePlotMean, datePlot,
PlotRange -> All, FrameLabel -> {"Hour", "Value"}];
<|FileBaseName@FileNameTake@file -> <|"data" -> data,
"selectedData" -> selectedData, "dataByDate" -> dataByDate,
"datePlot" -> datePlot, "datePlotMax" -> datePlotMax,
"datePlotMin" -> datePlotMin,
"combinedDatePlot" -> combinedDatePlot|>|>];
Process a list of files
files = {
"~/Downloads/Stats/K01-17(ANK120).csv",
"~/Downloads/Stats/K70-37 (ANK120).csv",
"~/Downloads/Stats/RS3710-TS1948 (ANK,120).csv",
"~/Downloads/Stats/RS3790-TS3775 (ANK,120).csv",
"~/Downloads/Stats/RS8650-TS3660 (ANK,120).csv",
"~/Downloads/Stats/RS5520-TS8902 (ANK,120).csv"};
results = processFile /@ files // Association;
The plot of value vs. hour of day for all days in the corresponding file.
#["combinedDatePlot"] & /@ results // Normal //
Partition[#, UpTo[2]] & //
Grid[#, Alignment -> Right, Spacings -> {0, 2}] &

There is a lot of variation in the data values in each of these files as you mentioned in your comment. Hope the approach above will help you perform the analysis you need.
Not sure what you mean by "basically count the average from all values from this day with the highest mean value dividing by nominal value and have a list of average values for each file eventually". If you can clarify that, I can help. Meanwhile, here is a way to simplify part of your code and speed it up by avoiding DateObject
and TimeSeries
. It makes use of the fact that the date/time strings are uniformly formatted.
data = Import["~/Downloads/Stats/K01-17(ANK120).csv", "Table", "FieldSeparators" -> ";"][[2 ;;, -2 ;;]];
selectedData = data // Select[(h = ToExpression@StringTake[First@#, 12 ;; 13]; h >= 10 && h <= 17) &];
maxMeanDay = selectedData // GroupBy[StringTake[First@#, 10] & -> Last] //
Map[Mean] // ReverseSort // Take[#, 1] &
(* <|"02.12.2018" -> 54.3485|> *)
nominalPILC120
? $\endgroup$