⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readhexin.txt

📁 读取同花顺炒股软件中本地文件中日线中的数据
💻 TXT
字号:
Sub test()
    Dim st As New ADODB.Stream
    Dim i, a, b, c, n As Integer
    Dim m, x As Long
       
    Dim txt, fdir, tCode As String
    
    With st
        .Mode = 3
        .Type = 1
        .Open
        .LoadFromFile ("E:\Stock\600591.day")
        'For i = 1 To 8
        '    .Read (64)
        'Next
    End With
    
    
    txt = st.Read
    m = 0
    n = (2 * Len(txt) - 64) / 48
    For a = 0 To n - 1
        For b = 1 To 7
            For c = 1 To 4
                x = AscB(MidB(txt, 48 * a + 4 * (b - 1) + c + 64, 1))
                If c = 1 Then m = m + x
                If c = 2 Then m = m + x * 256
                If c = 3 Then m = m + x * 256 * 256
                If c = 4 Then
                    If b = 1 Then
                        m = m + x * 256 * 256 * 256
                    Else
                        m = m + (x And 15) * 256 * 256 * 256
                    End If
                End If
            Next c
            If b = 1 Then
                Cells(a + 2, b).Value = Left(m, 4) + "-" + Mid(m, 5, 2) + "-" + Right(m, 2)
            Else
                If b = 6 Or b = 7 Then Cells(a + 2, b).Value = m / 10 Else Cells(a + 2, b).Value = m / 1000
            End If
            m = 0
        Next b
    Next a
    st.Close
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -