NSearch Posted April 27, 2005 Posted April 27, 2005 Input: 1297813913,1368aks79 Code: $Input = FileOpen ("C:\test.txt",0) If $Input = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf $trackno = FileReadLine($Input) $info = StringSplit($trackno, ",") $track_number = $info[0] $invoice_number = $info[1] Send($track_number]) Output: 2 Does anyone see what I am doing wrong here? Thank you.
Developers Jos Posted April 27, 2005 Developers Posted April 27, 2005 (edited) Input:1297813913,1368aks79Code:$Input = FileOpen ("C:\test.txt",0)If $Input = -1 Then MsgBox(0, "Error", "Unable to open file.") ExitEndIf$trackno = FileReadLine($Input)$info = StringSplit($trackno, ",")$track_number = $info[0]$invoice_number = $info[1]Send($track_number])Output:2Does anyone see what I am doing wrong here?Thank you.<{POST_SNAPBACK}>$info[0] will contain the number of elements found$info[1] is the first element (Track number)$info[2] is the second element (Invoice number) Edited April 27, 2005 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
NSearch Posted April 27, 2005 Author Posted April 27, 2005 Thank you very much....That is different from any other code I have used. Thanks.
PerryRaptor Posted April 27, 2005 Posted April 27, 2005 I use the function _FileReadToArray(). It takes the name of the file to convert and the name of the single-dimension array to store the data. You will need to add " #include <file.au3> " to the beginning of your script; without quotes.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now