Danke hat gepasst
Beiträge von bobmarley
-
-
leider hat nicht geklappt...
Mit welcher Funktion ich ich nach die Endung der Datei fragen und überspringen?
Thx in advance!
-
-
für dich vlt. 5 Minuten, aber für Anfänger wie ich ist bisschen schwierig. aber ist okay
-
Im gegenteil, ich finde es normal so, selbst wenn das Problem dort gelöst wurde, werde ich auch die Lösung hier posten.
und das Thema wird als gelöst markiert.
trotzdem danke!
-
Ich habe die Frage auf beide Seiten gestellt.
-
die Frage ist ja wie
C
Alles anzeigen#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here ;#ce ---------------------------------------------------------------------------- #include <GUIConstants.au3> #include <ComboConstants.au3> ; For GUICtrlCreateCombo #include <File.au3> ; For _FileListToArray Global $ComboExt, $Files ; For Find Files. $Form1 = GUICreate("Ordner kopieren & Endung umbenennen ", 618, 180, 193, 125) $Input_old = GUICtrlCreateInput("", 16, 16, 321, 21) $Datei = GUICtrlCreateButton("Ordner auswählen ", 352, 16, 257, 25, 0) $Go = GUICtrlCreateButton("kopieren und Umwandeln ", 136, 88, 361, 41, 0) $Input_new = GUICtrlCreateInput("", 16, 48, 321, 21) $Button1 = GUICtrlCreateButton("Neuer Pfad", 352, 48, 257, 25, 0) GUICtrlSetCursor($Datei, 0) ; ==> Added. GUICtrlSetCursor($Go, 0) ; ==> Added. GUICtrlSetCursor($Button1, 0) ; ==> Added. GUICtrlCreateLabel("Neue Endung", 520, 80, 80, 20, 1) ; ==> Added. $ComboExt = GUICtrlCreateCombo("", 510, 100, 100, 50, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) ; ==> Added. GUICtrlSetData($ComboExt, ".ABC|.DEF|", ".ABC") ; Choose The New Extensions Post File Move. ==> Added. GUICtrlSetCursor($ComboExt, 0) ; ==> Added. GUISetState(@SW_SHOW, $Form1) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit(0) Case $Datei ;~ ;$path = FileOpenDialog("choose folder or file's", @ScriptDir, "Alle Dateien (*.*)") $path = FileSelectFolder("Ordner auswählen", @ScriptDir) ; Correction / Added. GUICtrlSetData($Input_old, $path) Case $Button1 ;~ ;$path_new = FileSelectFolder ( "choose folder or file's", @ScriptDir, "Alle Dateien (*.*)") $path_new = FileSelectFolder("Ziel Ordner auswählen", @ScriptDir, 1) ; Correction / Added. GUICtrlSetData($Input_new, $path_new) Case $Go GUICtrlSetState($Go, $GUI_DISABLE) GUICtrlSetState($Datei, $GUI_DISABLE) GUICtrlSetState($Button1, $GUI_DISABLE) GUICtrlSetData($Go, "wait!.") $Files = _FileListToArray($path , "*.*" , 1) ; 1 = Return Files Only. ==> Added. If Not @error Then _Copy($Files) ; ==> Added. EndSwitch WEnd Func _Copy($Files) ; Copies All Files to The New Location With The Extension You Have Chosen. Local $ReadExt = GUICtrlRead($ComboExt) For $i = 0 To UBound($Files)-1 FileCopy($path & "\" & $Files[$i], $path_new & "\" & StringRegExpReplace($Files[$i], ".*\\|\.[^.]*", "") & $ReadExt) Next GUICtrlSetState($Go, $GUI_ENABLE) GUICtrlSetState($Datei, $GUI_ENABLE) GUICtrlSetState($Button1, $GUI_ENABLE) GUICtrlSetData($Go, "End of copy") EndFunc
-
Hallo Leute,
Ich habe ein Ordner besteht aus mehrere Dateien mit Der Endung ".xx" und ein Datenbank Datei ".db".
Ich habe ein Code erstellt, mit diesem Code kann ich diese mehrere Dateien mit der Endung "xx" in einem anderen Ordner auf einmal kopieren und deren Endungen gleichzeitig ändern. (wie z.B .txt zu .doc)
Mein Code ändert aber auch die Endung vom Datenbank Datei. wie kann ich hier Ausnahme machen. bzw. wie kann ich den Datenbank Datei umbennen z.B von "Test.db" zu "exam".db.
Für eure Hilfe wäre ich sehr dankbar.
-
ok danke, lieb von dir
-
ja, Vielen Dank trotzdem!
-
-
Ich hab's versucht.. aber ohne Erfolg
-
Hallo Leute,
Kann ich irgendwie die Nachkommastellen auf 2 Stellen runden?
-
Hallo Leute,
Kann jemand vlt. helfen, ich hab kleine Programm erstellt, womit ich ein Ordner Kopiere und in einem neuen Pfad einfügen kann. die Endungen der Datein in der Neuer Ordner sollen umbennant.
Ich kann den Pfad irgendwie nicht auswählen, kann ich irgendwie nur die Endungen einem Art von Dateien umbennen und den Rest bleibt.
C
Alles anzeigen#include <GUIConstants.au3> #include <ComboConstants.au3> ; For GUICtrlCreateCombo #include <File.au3> ; For _FileListToArray Global $ComboExt, $Files ; For Find Files. $Form1 = GUICreate("file's copy & rename the Extension ", 618, 134, 193, 125) $Input_old = GUICtrlCreateInput("", 16, 16, 321, 21) $Datei = GUICtrlCreateButton("choose folder or file's ", 352, 16, 257, 25, 0) $Go = GUICtrlCreateButton("copy and rename ", 136, 88, 361, 41, 0) $Input_new = GUICtrlCreateInput("", 16, 48, 321, 21) $Button1 = GUICtrlCreateButton("new path or folder", 352, 48, 257, 25, 0) GUICtrlSetCursor($Datei, 0) ; ==> Added. GUICtrlSetCursor($Go, 0) ; ==> Added. GUICtrlSetCursor($Button1, 0) ; ==> Added. GUICtrlCreateLabel("New Extensions", 520, 80, 80, 20, 1) ; ==> Added. $ComboExt = GUICtrlCreateCombo("", 510, 100, 100, 50, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) ; ==> Added. GUICtrlSetData($ComboExt, ".jpg|.bmp|.png|.gif|", ".jpg") ; Choose The New Extensions Post File Move. ==> Added. GUICtrlSetCursor($ComboExt, 0) ; ==> Added. GUISetState(@SW_SHOW, $Form1) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit(0) Case $Datei ;~ ;$path = FileOpenDialog("choose folder or file's", @ScriptDir, "Alle Dateien (*.*)") $path = FileSelectFolder("choose folder or file's", @ScriptDir) ; Correction / Added. GUICtrlSetData($Input_old, $path) Case $Button1 ;~ ;$path_new = FileSelectFolder ( "choose folder or file's", @ScriptDir, "Alle Dateien (*.*)") $path_new = FileSelectFolder("choose folder or file's", @ScriptDir, 1) ; Correction / Added. GUICtrlSetData($Input_new, $path_new) Case $Go GUICtrlSetState($Go, $GUI_DISABLE) GUICtrlSetState($Datei, $GUI_DISABLE) GUICtrlSetState($Button1, $GUI_DISABLE) GUICtrlSetData($Go, "wait!.") $Files = _FileListToArray($path , "*.*" , 1) ; 1 = Return Files Only. ==> Added. If Not @error Then _Copy($Files) ; ==> Added. EndSwitch WEnd Func _Copy($Files) ; Copies All Files to The New Location With The Extension You Have Chosen. Local $ReadExt = GUICtrlRead($ComboExt) For $i = 0 To UBound($Files)-1 FileCopy($path & "\" & $Files[$i], $path_new & "\" & StringRegExpReplace($Files[$i], ".*\\|\.[^.]*", "") & $ReadExt) Next GUICtrlSetState($Go, $GUI_ENABLE) GUICtrlSetState($Datei, $GUI_ENABLE) GUICtrlSetState($Button1, $GUI_ENABLE) GUICtrlSetData($Go, "End of copy") EndFunc