hey guys (or gals),
i'm trying to learn to code in VB, and i need to try and take a list as a .txt file, convert the information to an array, and then organize the list alphabetically
the .txt is listed in a format like "lastname, firstname, grade" and I'm having a hard time splitting the data up by the commas to find, for example, just the highest grade and then display the whole line in a listbox.
any and all help is appreciated, thanks in advance
Never messed with VB much, but these might help you:
http://msdn.microsoft.com/en-us/library/cakac7e6.aspx
http://www.dotnetperls.com/sort-list-vbnet
I'm not sure if this is the most optimal way to go about it, but if you just split the file into one list of strings (because I don't know if you can split into multiple lists) and then iterate through them and create three new arrays for each item.
In pseudocodeish:
//Spit file into String[] s
String[] first
String[] last
String[] grade
for(int i = 0; i < s.count/3; i++)
{
first[i] = s[i*3]
last[i] = s[i*3+1]
grade[i] = s[i*3+2]
}
Hope this helps. Good Luck!
thanks, Josh. this did help me out! i really appreciate it