Jump to content
Sign in to follow this  


Recommended Posts


hi every one

I need help with an array

here is my code

#include <String.au3>
#include <array.au3>
$file = FileOpen("wxlocal.html", 0)
$fileout = FileOpen("test1.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, '%', '%');Not using SRE
  ;MsgBox(0, "Line read:", $aArray1)
    If NOT @ERROR Then
      ;_ArrayDisplay($aArray1, 'Default Search')
        $test = _ArrayToString($aArray1,$a)
       ;$test= StringReplace($test," ","t")   
    $begin= "|%"
    $end ="%"
    $output= $begin&$test&$end
;MsgBox(0, "Line read:", $output)



here is the output i get if there is 1 item found on a line |%tempnodp%

were I am have trouble is if there is more then one item on a line i get




how can i change my code so no matter what it put a % on the end

thanks Beau

Share this post

Link to post
Share on other sites

Perhaps with this:

$aArray1 = _StringBetween($line, '%', '%');Not using SRE
    If Not @error Then
        For $a = 0 To UBound($aArray1) - 1
            $aArray1[$a] = "%" & $aArray1[$a] & "%"
        $a = @CRLF & "|"
        $output = "|%" & _ArrayToString($aArray1, @CRLF & "|%")
        FileWrite($fileout, $output & @CRLF)


Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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.