允许不同排序的最佳变量

时间:2010-12-16 19:37:48

标签: c# sorting

我将把以下数据读入2x2矩阵:

1   blnk1   Stk1-01 3   Unknown blnk1       C:\Xcalibur\data\8027_THC\Rawfiles  C:\Aria Data\AS Methods\USE THESE METHODS\THC_test.tmt
2   blnk2   Stk1-01 3   Unknown blnk2       C:\Xcalibur\data\8027_THC\Rawfiles  C:\Aria Data\AS Methods\USE THESE METHODS\THC_test.tmt
3   blnk3   Stk1-01 3   Unknown blnk3       C:\Xcalibur\data\8027_THC\Rawfiles  C:\Aria Data\AS Methods\USE THESE METHODS\THC_test.tmt
4   blnk4   Stk1-01 3   Unknown blnk4       C:\Xcalibur\data\8027_THC\Rawfiles  C:\Aria Data\AS Methods\USE THESE METHODS\THC_test.tmt
1   CAL1    Stk1-02 3   Standard    CAL1    1   C:\Xcalibur\data\8027_THC\Rawfiles  C:\Aria Data\AS Methods\USE THESE METHODS\THC_test.tmt
2   CAL2    Stk1-02 3   Standard    CAL2    2   C:\Xcalibur\data\8027_THC\Rawfiles  C:\Aria Data\AS Methods\USE THESE METHODS\THC_test.tmt
3   CAL3    Stk1-02 3   Standard    CAL3    3   C:\Xcalibur\data\8027_THC\Rawfiles  C:\Aria Data\AS Methods\USE THESE METHODS\THC_test.tmt
4   CAL4    Stk1-02 3   Standard    CAL4    4   C:\Xcalibur\data\8027_THC\Rawfiles  C:\Aria Data\AS Methods\USE THESE METHODS\THC_test.tmt
5   QC1 Stk1-02 3   QC  QC1 1   C:\Xcalibur\data\8027_THC\Rawfiles  C:\Aria Data\AS Methods\USE THESE METHODS\THC_test.tmt
6   QC2 Stk1-02 3   QC  QC2 2   C:\Xcalibur\data\8027_THC\Rawfiles  C:\Aria Data\AS Methods\USE THESE METHODS\THC_test.tmt
7   QC3 Stk1-02 3   QC  QC3 3   C:\Xcalibur\data\8027_THC\Rawfiles  C:\Aria Data\AS Methods\USE THESE METHODS\THC_test.tmt
8   QC4 Stk1-02 3   QC  QC4 4   C:\Xcalibur\data\8027_THC\Rawfiles  C:\Aria Data\AS Methods\USE THESE METHODS\THC_test.tmt
        Stk1-02 3   Unknown 0       C:\Xcalibur\data\8027_THC\Rawfiles  C:\Aria Data\AS Methods\USE THESE METHODS\THC_test.tmt
        Stk1-02 3   Unknown 0       C:\Xcalibur\data\8027_THC\Rawfiles  C:\Aria Data\AS Methods\USE THESE METHODS\THC_test.tmt
        Stk1-02 3   Unknown 0       C:\Xcalibur\data\8027_THC\Rawfiles  C:\Aria Data\AS Methods\USE THESE METHODS\THC_test.tmt
A01     Stk1-02 3   Unknown 0       C:\Xcalibur\data\8027_THC\Rawfiles  C:\Aria Data\AS Methods\USE THESE METHODS\THC_test.tmt
B02     Stk1-02 3   Unknown 0       C:\Xcalibur\data\8027_THC\Rawfiles  C:\Aria Data\AS Methods\USE THESE METHODS\THC_test.tmt
C03     Stk1-02 3   Unknown 0       C:\Xcalibur\data\8027_THC\Rawfiles  C:\Aria Data\AS Methods\USE THESE METHODS\THC_test.tmt
D01     Stk1-02 3   Unknown 0       C:\Xcalibur\data\8027_THC\Rawfiles  C:\Aria Data\AS Methods\USE THESE METHODS\THC_test.tmt
        Stk1-02 3   Unknown 0       C:\Xcalibur\data\8027_THC\Rawfiles  C:\Aria Data\AS Methods\USE THESE METHODS\THC_test.tmt
        Stk1-02 3   Unknown 0       C:\Xcalibur\data\8027_THC\Rawfiles  C:\Aria Data\AS Methods\USE THESE METHODS\THC_test.tmt
        Stk1-02 3   Unknown 0       C:\Xcalibur\data\8027_THC\Rawfiles  C:\Aria Data\AS Methods\USE THESE METHODS\THC_test.tmt
        Stk1-02 3   Unknown 0       C:\Xcalibur\data\8027_THC\Rawfiles  C:\Aria Data\AS Methods\USE THESE METHODS\THC_test.tmt
        Stk1-02 3   Unknown 0       C:\Xcalibur\data\8027_THC\Rawfiles  C:\Aria Data\AS Methods\USE THESE METHODS\THC_test.tmt

我需要能够按第一列对整个矩阵进行排序,第一列可能包含数字和字母。

使用哪种最佳数据类型?收藏?数组?我需要一些支持多种类型排序的东西。我认为类型可以只是字符串,在这种情况下,它可能会或可能不正确排序数字?

2 个答案:

答案 0 :(得分:1)

您可以使用此问题的答案中显示的数据表...

How do I sort a two-dimensional array in C#?

答案 1 :(得分:1)

您没有提供有关您将对此数据执行的操作的大量信息。

基本上,只有你提供的一般信息,我会选择DataSet