mikell Posted September 7, 2015 Share Posted September 7, 2015 Why are you trying complicated things ?Only 3 lines to include in the previous code#include <GUIConstantsEx.au3> #include <File.au3> $gui = GUICreate("Form1") $listview = GUICtrlCreateListView("file name|Size in byte|difference", 10, 10, 300, 200) GUISetState() $myfolder = "test_folder" ; full path of the folder containing txt files $csv = "file name;Size in byte;difference" & @crlf $files = _FileListToArray($myfolder, "*.txt", 1) For $i = $files[0] to 1 step -1 $name = $files[$i] $size = FileGetSize($myfolder & "\" & $files[$i]) $diff = ($i > 1) ? $size - FileGetSize($myfolder & "\" & $files[$i-1]) : "---" GUICtrlCreateListViewItem($name & "|" & $size & "|" & $diff, $listview) $csv &= $name & ";" & $size & ";" & $diff & @crlf Next FileWrite(@scriptdir & "\mycsv.csv", $csv) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Link to comment Share on other sites More sharing options...
RANA Posted September 8, 2015 Author Share Posted September 8, 2015 Try this (just a basis)#include <GUIConstantsEx.au3> #include <File.au3> $gui = GUICreate("Form1") $listview = GUICtrlCreateListView("file name|Size in byte|difference", 10, 10, 300, 200) GUISetState() $myfolder = "test_folder" ; full path of the folder containing txt files $files = _FileListToArray($myfolder, "*.txt", 1) For $i = $files[0] to 1 step -1 $name = $files[$i] $size = FileGetSize($myfolder & "\" & $files[$i]) $diff = ($i > 1) ? $size - FileGetSize($myfolder & "\" & $files[$i-1]) : "---" GUICtrlCreateListViewItem($name & "|" & $size & "|" & $diff, $listview) Next While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEndThanks Mikell Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now