Jump to content
Sign in to follow this  

New and dont know where to start.

Recommended Posts


Basically I want to write my own article spinner.

I write an article with 3 variations on a sentence, 3-4 sentences per paragraph.

What the script must do.

Read txt file one take line one make it variable 1, line 2 variable 2 then line 3 variable 3 then print one of the three variables to a new txt file, then continues to 4,5,6 and then prints one of them random to the txt file and continues till it reaches the end.

Save the new files.

the new files will be





Saves file then repeats x amount of time (random characters when naming the file to be saved)

Is this possible?

I want it to read from the source file and fill the variables in with text that is contained on that line.then randomly choose one of the 3 variable, then move to the next 3 and choose one and so on

I assume I start with getting it to read from the source file 1st. but where can I find information on this?

Share this post

Link to post
Share on other sites

Dim $sFile = @ScriptDir & '\123.txt'
Dim $sText = FileRead($sFile)

If Not StringLen($sText) Then
    MsgBox(0x10, 'Error', 'Could not open the file "' & $sFile & '"')

Dim $Arr = StringSplit($sText, @CRLF, 1)
If IsArray($Arr) Then
    $sText = ''
    For $i = 1 To $Arr[0] Step 3
        If $i + 1 > $Arr[0] Or $i + 2 > $Arr[0] Then
            $sText &= $Arr[$i]
        $sText &= $Arr[$i+Random(0, 2, 1)] & @CRLF
    If StringRight($sText, 1) = @LF Then $sText = StringLeft($sText, StringLen($sText)-2)
    Local $aPath = StringRegExp($sFile, '^(.*\\)(.*)$', 1)
    FileWrite($aPath[0]&'('&@MON&'-'&@MDAY&'-'&@YEAR&' '&@HOUR&'-'&@MIN&'-'&@SEC&')'&$aPath[1], $sText)

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.