Jump to content
Sign in to follow this  

how to pull txt from one file to another?

Recommended Posts


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

#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.")

; 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 )
    ;$aArray1[$a] = "" & $aArray1[$a] & "%"


Edited by n9mfk9

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.