blantek212 Posted August 28, 2017 Share Posted August 28, 2017 Hello everyone. I need help with scripts. I have some code which creates array, and next writes this array to a file (function _FileWriteFromArray). In the next step it creates second array. I would like to add this array to previous file, but function _FileWriteFromArray repleaces only content in the file. Is there any other way to solve this problem? Link to comment Share on other sites More sharing options...
xcaliber13 Posted August 28, 2017 Share Posted August 28, 2017 Try using FileOpen with the append before writing second array $sFilePath = "Path to your file" FileOpen($sFilePath, $FO_APPEND) _FileWriteFromArray(Your options Here) blantek212 1 Link to comment Share on other sites More sharing options...
blantek212 Posted August 28, 2017 Author Share Posted August 28, 2017 This is exactly what I need, works great Thanks Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 28, 2017 Moderators Share Posted August 28, 2017 blantek212, Do not forget to close the file handle when you have written the last array. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Luigi Posted September 10, 2017 Share Posted September 10, 2017 Greetings, You can use: FRED JSMN Visit my repository Link to comment Share on other sites More sharing options...
Pured Posted September 10, 2017 Share Posted September 10, 2017 I'm not sure what _FileWriteFromArray does, but the simplest thing you can do is something like this: $file = FileOpen("FILENAME.txt", 1) For Local $i = 0 To $array1Size FileWrite($file, $array1[$i], " ") ;Log to file. Next FileWrite($file, @CRLF) ;Newline. For Local $i = 0 To $array2Size FileWrite($file, $array2[$i], " ") ;Log to file. Next FileWrite($file, @CRLF) ;Newline. ;Etc... FileClose($file) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 10, 2017 Moderators Share Posted September 10, 2017 Pured, Quote I'm not sure what _FileWriteFromArray does Then I suggest opening the Help file and reading about the function rather then making inane and unhelpful comments like the above. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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