I have a text file that I have to work with frequently. It's submitted by a client, and I bring it into a VB.NET application to do various things.
Sample data:
The file contains various job numbers. On occasion, I'll have to remove lines containing one or more job number. (Each job number may appear in multiple lines.) This can be time-consuming, as the file is seldom in order by job number.
What I'd like to do is put the lines in an array, and sort by JOBNO. When I load to an array and do an Array.Sort, it comes back in order by DATE (the first field).
I have all the code in place to read from and write to text files as needed. This one piece would make my life much easier. If an array is not the answer, I'm open to suggestions.
I'd thought of loading into a dataset and sorting there, but it seemed like a bit of a long way around; besides, I need to learn more about arrays and their usage.
Thanks in advance.
Bryant Farley
"The Dude Abides
Sample data:
Code:
DATE EMP JOBNO AMT
7/25/2008 12345 XYZ12345 5.99
7/22/2008 23456 XYZ12346 4.99
7/21/2008 34567 XYZ12347 3.99
The file contains various job numbers. On occasion, I'll have to remove lines containing one or more job number. (Each job number may appear in multiple lines.) This can be time-consuming, as the file is seldom in order by job number.
What I'd like to do is put the lines in an array, and sort by JOBNO. When I load to an array and do an Array.Sort, it comes back in order by DATE (the first field).
I have all the code in place to read from and write to text files as needed. This one piece would make my life much easier. If an array is not the answer, I'm open to suggestions.
I'd thought of loading into a dataset and sorting there, but it seemed like a bit of a long way around; besides, I need to learn more about arrays and their usage.
Thanks in advance.
Bryant Farley
"The Dude Abides