Code: Select all
City := "North Smith Field" ;In csv it is North Smithfield
State := "RI"
CSV_Load(Path2, "RIstatecodes")
Cell1 := CSV_Search("RIstatecodes", City) ;Generates zero when exact match not found
if (Cell1 = 0)
{
Cell1A := StrSplit(City, " ")
Loop % Cell1A.length() ;3
{
LoopVar := A_Index
MsgBox % "LoopVar = " . LoopVar
Loop, % CSV_TotalRows("RIstatecodes")
{
found := CSV_Search("RIstatecodes", Cell1A[LoopVar], A_Index)
MsgBox % "Found = " . found . "`nCell1A[A_Index] = " . Cell1A[LoopVar] . "`nA_Index = " . A_Index . "`nLoop Var = " . LoopVar
if found=0
Break
Result := StrSplit(found, ",")
Results .= Result[1] ","
MsgBox % "Results = " . Results
}
Results .= ";"
}
}
The question is how do i go through each row and getting the matching 31 value as my final Cell value
I started with this but dont know where to go from here
Code: Select all
ResultsR := StrSplit(Results, ";")
Loop % ResultsR.Length()
{
ResultsC := StrSplit(ResultsR[A_Index], ",")
Loop % ResultsC.Length()
{
}
}