             counter_failed += 1
         }
 
+    }
+    return [filelist, filelist_failed, counter_failed]
+}
+
+ParsingFullDemofiles(RenamingMaskNumber, counter_files_quotient)
+{
+    Loop, Files, *.dem
+    {
+        counter_prog := counter_files_quotient * A_Index
+        GuiControl,, ProgressBar, %counter_prog%
+        mapstring := ""
+        File := FileOpen(A_LoopFileName, "r")
+        mapstring_formated := [] ;init Array Object (same as var := Object())
+        while !File.AtEOF
+        {
+            demofile := File.ReadLine()
+            RegExMatch(demofile, "maps[\/\\].+\.bsp", mapstring)
+            If mapstring
+            {
+                mapstring_formated.insert(Format("{1:s}", mapstring))
+            }
+        }
+        File.Close()
+
+        Mapname := []
+        x := 0
+        while A_Index <= mapstring_formated.MaxIndex()
+        {
+            needle := ""
+            If (InStr(mapstring_formated[A_Index], "maps") and InStr(mapstring_formated[A_Index], "bsp"))
+            {
+                RegExMatch(mapstring_formated[A_Index], "(?<=maps[\/\\]).+(?=\.bsp)", needle) ;RegEx lookahead and lookbehind
+                needle := Format("{1:s}", needle)
+                If (InStr(needle, "/") or InStr(needle, "\"))
+                {
+                    needle := RegExReplace(needle, ".+[\/\\]", "")
+                }
+                arraypos := HasVal(Mapname, needle)
+                If !arraypos
+                {
+                    ; MsgBox % "Mapname: " . Mapname . " needle: " . needle . " arraypos: " . arraypos "`n if"
+                    Mapname.InsertAt(1,needle)
+                }
+            }
+        }
+
+        If Mapname.MaxIndex()
+        {
+            Mapnames_all := ""
+            while A_Index <= Mapname.MaxIndex()
+            {
+                If Mapnames_all
+                {
+                    Mapnames_all := Mapnames_all . "+"
+                }
+                Mapnames_all := Mapnames_all . Mapname[A_Index]
+            }
+            SplitPath, A_LoopFileName,,,, FileNameNoExt
+            If (RenamingMaskNumber = 3) or (RenamingMaskNumber = 4)
+            {
+                FormatTime, mod_date, %A_LoopFileTimeModified%, yyyy-MM-dd
+            }
+            RenamingMask := []
+            RenamingMask[1] := filelist . A_LoopFileName . "`t" . FileNameNoExt . "_" . Mapnames_all . "." . A_LoopFileExt . "`n"
+            RenamingMask[2] := filelist . A_LoopFileName . "`t" . Mapnames_all . "_" . FileNameNoExt . "." . A_LoopFileExt . "`n"
+            RenamingMask[3] := filelist . A_LoopFileName . "`t" . mod_date . "_" . Mapnames_all . "_" . FileNameNoExt . "." . A_LoopFileExt . "`n"
+            RenamingMask[4] := filelist . A_LoopFileName . "`t" . mod_date . "_" . FileNameNoExt . "_" . Mapnames_all . "." . A_LoopFileExt . "`n"
+            filelist := RenamingMask[RenamingMaskNumber]
+        }
+        else
+        {
+            filelist_failed := filelist_failed . A_LoopFileName . "`n"
+            counter_failed += 1
+        }
     }
     return [filelist, filelist_failed, counter_failed]
 }

    else
    GuiControl,, text_example, Example: `n"samurai-vs-ninja.dem" will be renamed to "2007-05-03_samurai-vs-ninja_de_dust2.dem"
return

ButtonCancel:
GuiClose:

logfile_counter := 1
GuiControl, Disable, Start
GuiControl, Disable, RenamingMaskNumber
GuiControl, Disable, Option_1
GuiControlGet, RenamingMaskNumber
GuiControlGet, Option_1
FileSelectFolder, folder_demofiles,, 0, Please select your folder where your demofiles are. `nAll files with the ending *.dem will be renamed.
if ErrorLevel=0
{
