suhasbharadwaj Posted July 13, 2011 Posted July 13, 2011 Hi, I need an autoit script to search <ItemName>listBox_man_tray_paper_size<ItemName>, if it matches then change <Index>5</Index> content from 5 to 7. <SaveForm> <ItemName>checkBox_modelselect</ItemName> <Index>0</Index> <BVal>true</BVal> </SaveForm> <SaveForm> <ItemName>listBox_man_tray_paper_size</ItemName> <Index>5</Index> <BVal>false</BVal> </SaveForm> <SaveForm> <ItemName>checkBox81</ItemName> <Index>0</Index> <BVal>false</BVal> </SaveForm> Thanks, Suhas
wraithdu Posted July 13, 2011 Posted July 13, 2011 I need a million dollars. Looks like we're both leaving unhappy.
suhasbharadwaj Posted July 13, 2011 Author Posted July 13, 2011 Victoria, You mean the way of asking the query was improper? If so sorry for the same. Thanks! Suhas
Zedna Posted July 14, 2011 Posted July 14, 2011 $xml = FileRead('in.xml') $xml = StringRegExpReplace($xml, '(?s)<ItemName>listBox_man_tray_paper_size</ItemName>(.*?)<Index>(.*?)</Index>', '<ItemName>listBox_man_tray_paper_size</ItemName>$1<Index>7</Index>') FileDelete('out.xml') FileWrite('out.xml', $xml) Resources UDF ResourcesEx UDF AutoIt Forum Search
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