Jump to content

Recommended Posts

Posted

How do I import words from a text file to an INI. Text file format would be:

word1

word2

word3

...

to an INI format like this:

Key=word1,word2,word3,

Regards,

FireLord

[center]See the Helpfile[/center]

While Alive()
	 DrinkWine();
}
[center][/center]
Posted

#include <File.au3>
$Key = ""
$Count = _FileCountLines("Test.txt")
For $i = 1 To $Count
    $Text = FileReadLine("Test.txt", $i)
    If $i = 1 Then
        $Key = $Text & ","
    ElseIf $i = $Count Then
        $Key = $Key & $Text
    Else
        $Key = $Key & $Text & ","
    EndIf
Next
FileWrite("Test.ini", "Key=" & $Key)

Posted

#include <File.au3>
$Key = ""
$Count = _FileCountLines("Test.txt")
For $i = 1 To $Count
    $Text = FileReadLine("Test.txt", $i)
    If $i = 1 Then
        $Key = $Text & ","
    ElseIf $i = $Count Then
        $Key = $Key & $Text
    Else
        $Key = $Key & $Text & ","
    EndIf
Next
FileWrite("Test.ini", "Key=" & $Key)
Thank you so much. This works great!

[center]See the Helpfile[/center]

While Alive()
	 DrinkWine();
}
[center][/center]

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...