I haven't tried it, but I understand that you can use ADO.NET to read the whole file into a datatable, which would be considerably easier than manipulating it line by line. You would be right about the Split function, but if you can read the whole file into a datatable you won't need to worry about that. With a datatable, you can either sort/query on the table, or make a dataview based on the table and use the RowFilter method to restrict the table to just the desired rows.