mithandir1 Posted May 8, 2017 Posted May 8, 2017 I have a simple CSV file with 2 columns. I want to search for the value in the first column and return the value in the second. I have experimented with _arraysearch and can get it to retrun the correct row, but I can figure out how to get the value of the second column. I am sure this very simple, any help would be appreciated. Here is the code I have been playing with: #include <File.au3> #include <Array.au3> #include <MsgBoxConstants.au3> $tag = 1234 Local $aRetArray, $sFilePath = @ScriptDir & "\index.csv" _FileReadToArray($sFilePath, $aRetArray,"",",") _ArrayDisplay($aRetArray, "", Default, 8) $row = _ArraySearch($aRetArray, $tag,"","","","", 1) MsgBox(0,"This finds the row", $row)
Subz Posted May 8, 2017 Posted May 8, 2017 (edited) So to return the second column value you would use $aRetArray[$row][1] Edited May 8, 2017 by Subz mithandir1 1
mithandir1 Posted May 8, 2017 Author Posted May 8, 2017 Just now, Subz said: So to return the second column value you would use $aRetArray[$row][1] Thank you very much. I knew it had to simple.
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