2025年2月11日火曜日

aaaaaa

    ' ++++++++++++++++++++++++++++++
    'テキストインポート
    Dim sKEY    As String
    Dim iPos    As Integer
    
    sKEY = "EXEC"
    sKEY = Worksheets(L_SHEET).Cells(1, 2)
    Open sG_SRC For Input As #1
    Open sG_SRC & ".csv" For Output As #2
    i = G_RowSta
    iCnt = 0
    Do Until EOF(1)
        Line Input #1, sRec
        wsM.Cells(i, G_ColSta1) = sRec
        wsM.Cells(i, G_ColSta2) = sRec
        iCnt = iCnt + 1
        i = i + 1
        '
        iPos = InStr(1, sRec, sKEY)
        If iPos > 0 Then
            'Print #2, iCnt & "," & iPos & "," & Right(sRec, iPos - 1)
            
            sRec = Replace(sRec, " ", ",")
            '           sRec = Replace(sRec, " ", ",", iPos + Len(sKEY) + 3)
            Print #2, iCnt & "," & iPos & "," & Mid(sRec, iPos)
        End If
    Loop
    Close #1
    Close #2
    ' ++++++++++++++++++++++++++++++