jinbaba Posted July 31, 2008 Posted July 31, 2008 Hello Folks, I want to copy a substring from a string. Since autoit strings are not like C strings. I am unable to copy a portion of string to new string. I want to extract file size from a torrent file. And I want torrent file to be unchanged. Here is how I tried ; Fille size $fh = FileOpen("C:\Documents and Settings\User\My Documents\torrents\file.torrent", 0) $contents = FileRead($fh) ; File size is mentioned after keyword 'length' $startI = StringInStr($contents, "lengthi") $endI = StringInStr($contents, ":", 1, 1, $startI) ; I want to copy string between startI and endI to a new string. How to do that? Your help required. Regards, JinBaba
maroesjk Posted July 31, 2008 Posted July 31, 2008 $content = FileRead('C:\Documents and Settings\User\My Documents\torrents\file.torrent') $start = StringInStr($content, 'length') $end = StringInStr($content, ':', 0, 1, $start) $size = StringMid($content, $start, $end - $start) mmfalcao 1
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