All pastes #430722 Raw Edit

Mine

public text v1 · immutable
·published 2007-04-09 06:04 UTC
rendered paste body
Private Sub Command1_Click()
Dim file As Byte 'Output file
Dim size As Long 'File size
Dim curpos As Long 'Current position in file
Dim cursubpos As Long 'Current position in current file
Dim curfile As Long 'Current file number
Dim eachbyte As Double 'progressbar increment for each byte progression

List1.AddItem "Checking files..."
lblStatus.Caption = "Reading " & Trim(Str(FileLen(txtInput))) & " bytes"
List1.AddItem Trim(FileLen(txtInput)) & " bytes"
size = FileLen(txtInput)
eachbyte = Round((100 / size), 10)

Open txtInput For Binary As #1 'Open the input file
cursubpos = 1
For curpos = 5127996 To 5531239 Step 1 '5127996 To 5531239
    Seek #1, curpos
    Get #1, , file
    Open txtOutput & "\test.raw" & curfile For Binary As #2 'Open the output file
    Put #2, cursubpos, file
    Close #2
    cursubpos = cursubpos + 1
    ProgressBar1.Value = ProgressBar1.Value + eachbyte
    lblStatus.Caption = Str(cursubpos)
Next curpos
Close #1

lblStatus.Caption = "Read " & cursubpos & " bytes."

End Sub