hey /prog/, I only started programming a couple months ago, so sorry for being a complete noob, but in VB 2008 can I read a file with io.streamreader, and sort every other line alphabetically? ie. name data name 2 data 2 names alphabetically keeping data in order thanks, in return I offer my gratitude
Name:
Anonymous2008-11-20 18:32
Use a List of KeyValuePairs of String, String. Read the first line and use as a key, then read the second line and use as the value. Add to the list. Repeat until the end of the file.
Then sort the list using its built in method, specifying a comparer function that compares just the keys of the KeyValuePairs.
Now do whatever you needed to do with that sorted list .. print it, write it back to a file, etc.