mucitbey Posted August 19, 2023 Share Posted August 19, 2023 Hello, The "|" read in Value07 that I want to do about the code and sample ini file I shared. by finding the total of each data number between and creating columns in the form of R-001, R002 as much as this number, and writing each data in these columns, and writing this total value in the last total column. The number of data in Value07 can be variable, that is, "1" or "40". But other than that, Value01, 02, 03 ,04, 05, 06 are all single values. Thanks in advance to anyone who can help with this. #include <File.au3> #include <Array.au3> #include <GUIConstants.au3> Global $aArr, $aSect = "" $File = FileOpenDialog("Select ini file", @ScriptDir&"\", "(*.ini)") _FileReadToArray($File, $aArr) $gui = GUICreate("ListView", 800, 300, 80, 5) $Lview = GUICtrlCreateListView("DATE&VALUE|R-001|R-002|R-003|R-004|R-005|R-006|R-007|R-008|R-009|R-010|TOTAL", 10, 10, 780, 280) GUICtrlSetState($Lview, $GUI_DROPACCEPTED) GUISetState() For $i = 1 To $aArr[0] Step 1 GUICtrlCreateListViewItem($aArr[$i], $Lview) Next GUICtrlSendMsg($Lview, $LVM_SETCOLUMNWIDTH, 0, 100) Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE Quote [18.08.2023] Value01=Chıcken Doner Value02=Rice Value03=Coke Value04=PC-KITCHEN Value05=Administrator Value06=18.08.2023 16:31:18 Value07=Micheal|Harry|Claire|Leon|Chris|Alice|Jill|Ashley 18.08.2023.ini file content Link to comment Share on other sites More sharing options...
ioa747 Posted August 19, 2023 Share Posted August 19, 2023 (edited) if I understood correctly #include <File.au3> #include <Array.au3> #include <GUIConstants.au3> Global $aArr, $aSect = "" $File = FileOpenDialog("Select ini file", @ScriptDir&"\", "(*.ini)") _FileReadToArray($File, $aArr) $aVal7 = StringSplit($aArr[8], "=") $aVal7 = StringSplit($aVal7[2], "|") ConsoleWrite("$aVal7[0]=" & $aVal7[0] & @CRLF) $aArr[8] = StringStripWS(StringReplace($aArr[8], "=", "=|"), 3) & "|" & $aVal7[0] ConsoleWrite("$aArr[8]=" & $aArr[8] & @CRLF) $sHeader = "" For $i = 1 To $aVal7[0] $sHeader &= "R-" & StringFormat("%03i", $i) & "|" Next ConsoleWrite("$sHeader=" & $sHeader & @CRLF) $GuiData = "DATE&VALUE|" & $sHeader & "TOTAL" $gui = GUICreate("ListView", 800, 300, 80, 5) $Lview = GUICtrlCreateListView($GuiData, 10, 10, 780, 280) GUICtrlSetState($Lview, $GUI_DROPACCEPTED) GUISetState() For $i = 1 To $aArr[0] Step 1 GUICtrlCreateListViewItem($aArr[$i], $Lview) Next GUICtrlSendMsg($Lview, $LVM_SETCOLUMNWIDTH, 0, 100) Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE Edited August 19, 2023 by ioa747 add StringStripWS mucitbey 1 I know that I know nothing Link to comment Share on other sites More sharing options...
mucitbey Posted August 20, 2023 Author Share Posted August 20, 2023 You got it absolutely right. Thank you. 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