(ZJ)
52368
53698
52145
53X69
58631




53674
这样的报文,
最后要写个函数,跳过(ZJ)这一行,显示文本如下:
52368 53698 52145 53/69 53684    
53674=
一行不超过10个数,
在最后一个数后加个=
遇到X显示为/
该如何编写???
急需,,,,高分赠!!!

解决方案 »

  1.   

    Dim lngTmp      As Long
    Dim strFile     As String
    Dim aa()        As String
    On Error GoTo PROC_ERR
        lngTmp = FreeFile()
        Open strPath For Binary Access Read As #lngTmp
        strFile = CStr(Input(LOF(lngTmp), #lngTmp))
        Close #lngTmp
        aa = Split(strFile, Chr(13))
        lngLine = UBound(aa)
        GetFileLine = True
        Exit Function
    PROC_ERR:
        GetFileLine = Falseaa中存放的就的是那个文件Dim lngTmp      As Long
    Dim strFile     As String
    Dim aa()        As String
    On Error GoTo PROC_ERR
        lngTmp = FreeFile()
        Open strPath For Binary Access Read As #lngTmp
        strFile = CStr(Input(LOF(lngTmp), #lngTmp))
        Close #lngTmp
        aa = Split(strFile, Chr(13))
        lngLine = UBound(aa)
        GetFileLine = True
        Exit Function
    PROC_ERR:
        GetFileLine = False
    aa中存放的就是每一行的数据!
    dim i   as integer
    dim str as string 
    dim lngtemp as long 
    dim lngCount1 as long
    dim strTmp   as string 
      i=0
    dim strVal  as string 
    for lngtmp=lbound(aa) to ubound(aa)
     if i mod 10<>0 then
        i=i+1
        strval=trim(aa(lngtmp))
        for lngtemp=1 to len(trim(aa(lngtmp)))
           strtmp=left(strval,1)
           if strtmp="x" then
               str=str & "/"
           else
              str=str & strtmp
           end if
           strval=mid(strval,2,len(strval)-1)
        next lngtemp
     else
        strval=trim(aa(lngtmp))
        for lngtemp=1 to len(trim(aa(lngtmp)))
           strtmp=left(strval,1)
           if strtmp="x" then
               str=str & "/"
           else
              str=str & strtmp
           end if
           strval=mid(strval,2,len(strval)-1)
        next lngtemp
        str=str & vbCrLf
     end if
    next lngtmp
     msgbox str 
     str中存的就是那个信息!