I have a txt file with numbers and comma separated lines like this for example.
4324,1dd3,444
4324,1fd3,444
4324,1as3,442
I have a function that takes a string as a parameter, and I want to check for each line if that string is equal to the second "word" of the line, so in line one that would be "1dd3". If that parameter matches the word I want to add the third word of the row to a string list (or save it some other way to use it later on in the code).
In C# I would simply loop through the list and use a split on the commas like this
while(reader.Peek > 0) //while txt file still has lines left to read
{
split the row...
compare it to argument
add to list of strings
}
But I am fairly new to F# and can't find the right syntax and or method of doing this here, any help would be appreciated.