COD3369 Posted February 3, 2014 Share Posted February 3, 2014 #include<string.au3> #include <File.au3> $in = "" Dim $string = "687474703a2f2f7777772e6175746f69747363726970742e636f6d2f666f72756d2f746f7069632f36333933372d686f772d746f2d73706c69742d612d737472696e672d61667465722d342d636861726163746572732f", $result $aNumber = StringRegExp($string, "\N{15}", 3) For $i = 0 To UBound($aNumber) - 1 $result &= "Global "&"$vVar" &$i & "= " & """" & $aNumber[$i]&"""" & @CRLF Next $result = StringTrimRight($result, 1) FileWrite ( @scriptdir & "\code.au3" , $result ) its working good splitting the line at every 15 chars but its not writing the last 9 characters to file 46572732f Output of code.au3 Global $vVar0= "687474703a2f2f7" Global $vVar1= "777772e6175746f" Global $vVar2= "697473637269707" Global $vVar3= "42e636f6d2f666f" Global $vVar4= "72756d2f746f706" Global $vVar5= "9632f3633393337" Global $vVar6= "2d686f772d746f2" Global $vVar7= "d73706c69742d61" Global $vVar8= "2d737472696e672" Global $vVar9= "d61667465722d34" Global $vVar10= "2d6368617261637" Where am wrong guys I got this script from some where and I just input my string and change the to 15 Link to comment Share on other sites More sharing options...
johnmcloud Posted February 3, 2014 Share Posted February 3, 2014 #include <Array.au3> ;just for test Local $sString = "687474703a2f2f7777772e6175746f69747363726970742e636f6d2f666f72756d2f746f7069632f36333933372d686f772d746f2d73706c69742d612d737472696e672d61667465722d342d636861726163746572732f" ;Dim is deprecated! Local $sEvery = 15 $sFinal = StringSplit(StringRegExpReplace($sString, "\w{" & $sEvery & "}", "\0|"),"|") _ArrayDisplay($sFinal, "Johnmcloud Test Code") Link to comment Share on other sites More sharing options...
bogQ Posted February 3, 2014 Share Posted February 3, 2014 (edited) StringRegExp($string, ".{1,15}", 3)orStringRegExp($string, "(?s).{1,15}", 3) Edited February 3, 2014 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
COD3369 Posted February 4, 2014 Author Share Posted February 4, 2014 bogQ Thanks Brother 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