Jump to content
Sign in to follow this  
aguynamedray

Search Strings and Compare

Recommended Posts

aguynamedray

Hello AutoIT MPVs,

Can somebody help me how to search a value of an element in xml file and compare with a value of an element in other xml file within the directory and creates a log file if error or match.

e.g.

The element to look for is <url> and the value is http://some-url.com - 1st xml

The element to look for is <website> and the value is http://some-url.com - 2nd xml

Please I need it badly. Thanks.

Edited by aguynamedray

Share this post


Link to post
Share on other sites
water

To work with XML please have a look at the


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • bhns
      By bhns
      try it for make flyers old games xml + Gdi, i belive many sources had lost 
      AIT-ADRLIST.au3

    • nooneclose
      By nooneclose
      My program has to first search for names in Column D that do not match up with column C. I got that search to work using arrays. It was slow and I could not figure out how to delete them so I just manually put coded the names that do not belong. I found their cell location but I do not know how to store that location and delete it.
      This is what I have so far.
      Local $NameToDelete1[6]  = _Excel_RangeFind($OpenWorkbook, "Smith, Bill") _ArrayDisplay($NameToDelete1, "Excel UDF: _Excel_RangeFind Example 1", "", 0, "|", "Sheet|Name|Cell|Value|Formula|Comment") _Excel_RangeDelete($OpenWorkbook.ActiveSheet, $NameToDelete1[2], $xlShiftUp)  
      Please help, I wanted to have this program done yesterday but I did not see this problem until yesterday. 
    • Rskm
      By Rskm
      Hi, I have the following line in a text file 'input.txt'. I know the line number - say '6'. I wish to replace the text 'WWW' in the below line with a random number (I can generate that with random()).
      WERIS  WWWJP   3.83  8.330  1.000                1097.RAXX 
      The WWW is a 3 digit integer (could be any number between 0 to 999), I can use stringtrimleft and get the numerical value of WWW in this file
      so, basically, I know the string to replace (ie; WWW stored in a variable), I know the line number to work on and the file location/name and the replacement variable (through random()). My requirement is to fill that 3 spaces with my random number (which Is a integer between 1 and 999)
      please put ur suggestions
       
    • AndyS19
      By AndyS19
      I'm trying to implement a Ctl-F popup box that looks something like the one that Notepad uses, but I'm not havine much luck.  I intend to get it working, then beef up the popup's contents to add several checkboxes, buttons and radio boxes.
      What my example code does is to use InputBox(), but that's not what I want.
      Here is my test code:
      #include <Array.au3> #include <GUIConstantsEx.au3> #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 Opt("GUICloseOnESC", 1) Opt("GUIOnEventMode", 1) Opt('MustDeclareVars', 1) OnAutoItExitRegister("ExitStageLeft") Opt("WinTitleMatchMode", -2) Global $hGUI _Main() Func _Main() $hGUI = GUICreate("Test ^F", 300, 200) setupSpecialKeysHandlers() GUISetOnEvent($GUI_EVENT_CLOSE, "Event_GUIClose") GUISetState() While (1) Sleep(157) WEnd EndFunc ;==>_Main Func handle_CTRL_F_key() Local $str $str = InputBox("Search", "Enter the string to search for:") ConsoleWrite("+++: $str ==>" & $str & "<==" & @CRLF) EndFunc ;==>handle_CTRL_F_key Func ExitStageLeft() Exit (99) EndFunc ;==>ExitStageLeft Func Event_GUIClose() Exit (1) EndFunc ;==>Event_GUIClose Func setupSpecialKeysHandlers() Local $ar, $parts, $key, $handler, $id Local $aAccelKeys[1][2] ; Create a table of Special keys and their handlers $ar = StringSplit("", "") _ArrayAdd($ar, "^f - handle_CTRL_F_key ") ReDim $aAccelKeys[UBound($ar) - 1][2] ; Now, create $aAccelKeys array with the table data. ; For each entry, create a Dummy GUI and associate its ; ID with the special key. For $ndx = 1 To UBound($ar) - 1 $parts = StringSplit($ar[$ndx], "-", 2) $key = StringStripWS($parts[0], 8) $handler = StringStripWS($parts[1], 8) $id = GUICtrlCreateDummy() $aAccelKeys[$ndx - 1][0] = $key $aAccelKeys[$ndx - 1][1] = $id GUICtrlSetOnEvent($id, $handler) Next GUISetAccelerators($aAccelKeys) ; Setup the Special keys hooks EndFunc ;==>setupSpecialKeysHandlers  
    • CosminV
      By CosminV
      Hello guys,
       
      This XML things are driving me crazy...
      Please let me know how can I use the _XMLGetAttrib function... I've tried every possible way that I've read on the forum and I cannot succeed reading an attribute.
       
      The XML looks like bellow:
       
      <?xml version="1.0" encoding="UTF-8"?>
      <BATCH attr1= "aaa" attr2="bbb" attr3="ccc">
           <Node1 attr1="aaa" attr2="bbb" attr3="ccc" attr4="ddd" attr5="" attr6="eee" attr7="fff" attr8="ggg"/>
           <Node2 attr1="aaa" attr2="" attr3="" attr4="ddd"/>
           <Node3 attr1="" attr2="" attr3="ccc" attr4="" attr5="" attr6="eee"/>
           <Panel attr1="aaa" STATUS="BBB" attr3="ccc" attr4="ddd" attr5="" attr6="eee">
                <Node5 attr1="aaa" attr2="bbb" attr3="ccc" attr4="ddd" attr5="" attr6="eee" attr7="fff" attr8="ggg"/>
                .............................................................................................................................................................................
           </Panel>
      </Batch>
       
      I need to read the value of STATUS form the Panel node.
       
      Could you please help me?
       
      Best regards,
      Cococnb
×