Completed part code is as follows:
Filename=ThisWorkbook. Path & amp; "\ block_gn. Dat"
The Open Filename For Binary As # 1 'to Open the file read-only way, refer to the help of the Open method
FileLen=LOF (1) - 386
ReDim FileByte (FileLen) As Byte
Get # 1, 387, FileByte () '386th (0) at the beginning start plate information, each point of 2813 bytes, started the second plate to 3199 bytes
Close # 1
ReDim FileStr (FileLen) As String
For I=1 To FileLen
J=I Mod 2813 'take each plate record number
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
O buffering part
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
If j=0 then
Sheet1. Cells (Int (I/2813) + 2, 1)=bkname 'plate name
Sheet1. Cells (Int (I/2813) + 2, 2)=gpcode contains stock code
'Bkname=""
Gpcode=""
End the if
Next I
CodePudding user response:
In the way of thinking, their success solvePrivate Declare Sub CopyMemory Lib "kernel32. DLL" Alias "RtlMoveMemory" (ByRef Destination As Any, ByRef Source As Any, ByVal Length As Long)
FileByte Call CopyMemory (bkName (0), (I - 1) * (2813), 8)
FileByte Call CopyMemory (gpCode (0), ((I - 1) * 2813 + 13), 2800)
BK=StrConv (bkName vbUnicode)
GP=StrConv (gpCode vbUnicode)