wisem2540 Posted June 23, 2014 Share Posted June 23, 2014 So this is kind of a continuation of my event viewer question. I have successfully returned some sample data... Now, I would like to know a way I could format the array in such a way that each "Event" would be returned as an element of the array. This code should help demonstrate. #include <Array.au3> #include <Constants.au3> #RequireAdmin $Run = Run (@ComSpec & " /c " & 'wevtutil qe Setup /f:text', "", @SW_HIDE, $STDOUT_CHILD) Do Sleep (250) Until $Run <> "" $sOutput = StdoutRead($Run, False, False) $Array = StringSplit ($sOutput, @CR) _ArrayDisplay ($Array) Is there a way to delimit by the word, EVENT? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 23, 2014 Moderators Share Posted June 23, 2014 wisem2540,Try this:; You will probably need this at the top of the script StringConstants.au3 ; Split on the word "EVENT" - you need the flag to use the entire string as the delimiter $Array = StringSplit ($sOutput, "EVENT", $STR_ENTIRESPLIT)Any luck? If not then please post an example of the string you receive in $sOutput so we can see what you are trying to split. 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...
wisem2540 Posted June 23, 2014 Author Share Posted June 23, 2014 That does work, except I found out that it was case sensative. So the line is actually Event[1] and Event[2] and so on. So Im trying to find a way I can do "Event[$AnyNumber]" I am experiementing with CHR.... we will see Link to comment Share on other sites More sharing options...
wisem2540 Posted June 23, 2014 Author Share Posted June 23, 2014 (edited) Here is an example... The idea here would be to take everything starting with "Event[$Number]" and make it its own element, or maybe even its own array. removed Edited June 24, 2014 by wisem2540 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