首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

求高手解答有关问题

2013-01-09 
求高手解答问题数据格式:4027035.9831.987683202303712000 99990 999910.46.0523.3 9999 999912 9999 9999

求高手解答问题
数据格式:
40270   35.98   31.98  768   32    0  230    3   71    2    0    0
      0 9999    0 9999   10.4    6.0    5   23.3 9999 9999    1    2 9999 9999
67215   40.50  -12.96   50   32    1  180    5  175 9999    0    0
      0   31    1  600   20.4   30.0    0   22.1   20   10    1    2 9999 9999
91334  151.85    7.47    2   16    8 9999 9999  106   14    8    6
   9999   33    3  300   24.6   23.0   60   26.4   27 9999    1    2 9999 9999
67283   36.88  -17.87   16   32    3    0    0  172 9999    0    0
      0   32    3  600   18.7   30.0    0   19.8   20   10    1    2 9999 9999
13586   21.65   41.97  239   32    0    0    0  176    6    0    0
      0 9999    0 9999    5.1   20.0    0   15.2 9999 9999    1    2 9999 9999
68906   -9.87  -40.34   54   32    6  230    3  249    8    0    0
      0   32    6  600   -1.7   9999    0    3.6   20   10    1    2 9999 9999
89004   -9.74  -74.19 1440   32 9999  130   13  952    3 9999 9999
      0 9999 9999 9999  -26.7   9999 9999  -21.8 9999 9999    1    2 9999 9999
程序:
double[] a1 = new double[1000];    
                    string mylinea1 = " ";
                    StreamReader myReadera1 = new StreamReader(@"D:\360Downloads\新建文件夹\201209\surface\plot\12083108.000", Encoding.GetEncoding("GB2312"));


                    int j = 0;
                    mylinea1 = myReadera1.ReadLine();
                    mylinea1 = myReadera1.ReadLine();
                    while ((mylinea1 = myReadera1.ReadLine()) != null)
                    {
                        j=j+1;
                        mylinea1 = mylinea1.Replace("  ", " ");
                        mylinea1 = mylinea1.Replace("   ", " ");
                        mylinea1 = mylinea1.Replace("  ", " ");
                        string [] sArraya1 = mylinea1.Split(' ');
                       
                            if (sArraya1[0] == Convert.ToString(53513))                               
                            {
                                a1[0] = Convert.ToDouble(sArraya1[5]);
                                
                            }
                       }  
但是读不出来求解答    
[解决办法]


            StreamReader reader = new StreamReader("c:\\temp\\1.txt",Encoding.Default);
            string source = reader.ReadToEnd();
            Regex reg = new Regex(@"(?is)[\S]+");
            MatchCollection mc = reg.Matches(source);


            foreach (Match m in mc)
            {
                comboBox1.Items.Add(m.Value);
            }

热点排行