Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Question about an array

$
0
0
I have a csv file that I changed to an ini file. Here are a few sample lines:

1,John,Smith,John.Smith@gmail.com,password
2,Jane,Fonda,Jane.Fonda@gmail.com,password
etc

I want to seperate line 1 into:

$Number = 1
$FirstName = John
$LastName = Smith
$Email = John.Smith@gmail.com
$Password = password

Then I want to use the above data and then replace all the above data with the data in the next line in the ini file. What I've pieced together so far (corrrect me if im wrong) is the following:

While 1
Local $file = FileOpen ("names.ini", 0) ;Open the names.ini file into memory
Local $LineNo = 1 ;Line Being read into memory
Local $Array[5] ;sets array memory to 6 places

	If $file = -1 Then
		MsgBox(0, "Error", "Unable to open names.ini")
		Exit
	EndIf ;Checks if file opened

$Array = FileReadLine($file, $LineNo) ;Sets $Array to be the line in Names.ini


I am not sure how to take the data before the first "," and set it to $Number and the second part of the string to $FirstName etc. Help

Viewing all articles
Browse latest Browse all 12506

Trending Articles