n9mfk9 Posted January 10, 2008 Posted January 10, 2008 (edited) HI Everyone i need some help pull data form a txt file here what I have to start with I have included what i am get an what im trying to get im not sure how to grap parts of the text thanks beau expandcollapse popup#include <String.au3> #include <array.au3> Dim $tag Dim $tagname $file = FileOpen("tagslist.txt", 0) $fileout = FileOpen("myphp.txt", 1) ;Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop $aArray1 = _StringBetween($line, '%', '%') If Not @error Then ; _ArrayDisplay($aArray1, 'Default Search') For $a = 0 To UBound($aArray1) - 1 $tag = '%'& $aArray1[$a]&'%' $tagname = $aArray1[$a] $tagname = StringReplace($tagname,'-','_') $tagname = StringReplace($tagname,'<','LT') $tagname= StringReplace($tagname,'>','GT') $tagname = StringReplace($tagname,'=','') $tagname = StringReplace($tagname,'/','_') $tagname = StringReplace($tagname,',','CM') FileWrite($fileout, '$'&$tagname& ' = ' &'"'&$tag&'"'&';' &@CRLF ) ;MsgBox(0,'',$aArray1[$a]) ;$aArray1[$a] = "" & $aArray1[$a] & "%" Next EndIf WEnd FileClose($fileout) FileClose($file) Edited January 22, 2008 by n9mfk9
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