本帖最后由 a278401627 于 2013-01-28 02:37:46 编辑

解决方案 »

  1.   

    看来只有像一楼那样自己比较!
    使用这个// crt_strcmp.c#include <string.h>
    #include <stdio.h>
    #include <stdlib.h>char string1[] = "The quick brown dog jumps over the lazy fox";
    char string2[] = "The QUICK brown dog jumps over the lazy fox";int main( void )
    {
       char tmp[20];
       int result;   // Case sensitive
       printf( "Compare strings:\n   %s\n   %s\n\n", string1, string2 );
       result = strcmp( string1, string2 );
       if( result > 0 )
          strcpy_s( tmp, _countof(tmp), "greater than" );
       else if( result < 0 )
          strcpy_s( tmp, _countof (tmp), "less than" );
       else
          strcpy_s( tmp, _countof (tmp), "equal to" );
       printf( "   strcmp:   String 1 is %s string 2\n", tmp );   // Case insensitive (could use equivalent _stricmp)
       result = _stricmp( string1, string2 );
       if( result > 0 )
          strcpy_s( tmp, _countof (tmp), "greater than" );
       else if( result < 0 )
          strcpy_s( tmp, _countof (tmp), "less than" );
       else
          strcpy_s( tmp, _countof (tmp), "equal to" );
       printf( "   _stricmp:  String 1 is %s string 2\n", tmp );
    }
      

  2.   

    CString.Find("$")//查找
    CString.Mid(pos1,pos2)//截取
      

  3.   

    如果数据很多的话,我建议你用fstream读取,我看每个数据都是用$8结尾的,用这个判断  ,当$8前面是你需要的数据时你就保存起来……
      

  4.   

    把文件 全部 读入 buffer (注意 加个 0)
    char *pStartAt=strstr(buffer,“631”);
    char pEndAt=pStartAt;
    while((*pEndAt != 13 ) && (*pEndAt != 10 )) pEndAt++;
      

  5.   


    CString str;
    int npos;
    str=6310A224488610$2$0.0.16$8;
    npos=str.Find('$');
    str.delete(0,npos+1);
    npos=str.Find('$');
    str=str.Left(npos);
    此时str的值为第一个$和第二个$之间的字符串。
    楼主可用while循环将整行以$分解成若干元素,直接取第二个元素。
      

  6.   

    nizhiqiang1128 这位朋友,用你的代码已经可以的把2提取出来了,谢谢不过现在的关键问题是怎么把6310A224488610$2$0.0.16$8;
    这行读出来