|
Option Explicit
Sub FullPath_Get() 'パス取得用
Dim path1 As String
path1 = "C:\Documents and Settings\デスクトップ\temp"
Dim i As Integer, Dir_Number(6) As String
For i = 0 To 6
Select Case i
Case 0
Dir_Number(i) = "1"
Case 1
Dir_Number(i) = "2"
Case 2
Dir_Number(i) = "3"
Case 3
Dir_Number(i) = "4"
Case 4
Dir_Number(i) = "5"
Case 5
Dir_Number(i) = "6"
Case 6
Dir_Number(i) = "7"
End Select
Next i
path2 = path1 & "\" & Dir_Number(i)
fullpath = path2 & "\" & "*" & .txt 'このあたりの設定の仕方がわかりません。ファイル数がわからないときなどにも対応したいです。
End Sub
Sub File_Read() 'ファイル読み込み用
file_No = FreeFile
Open fullpath For Input As file_No
Do While Not EOF(file_No)
Line Input #file_No, season_data
Call File_check '別ルーチンの呼び出し
Loop
Close file_No
End Sub
Sub File_check() 'ファイルの中身チェック用
Dim Us() As String, Data() As String
If InStr(season_data, ";") > 0 Then
user = Mid(season_data, InStr(season_data, ";") + 1, Len(season_data) - InStr(season_data, ";") - 1)
Us() = Split(user, ",")
season_data = Mid(season_data, 1, InStr(unyoudata, ";") - 1)
Data() = Split(season_data, ",")
End If
Else
Data() = Split(season_data, ",")
End Sub
力不足でこのような感じでしかできていませんが、処理をルーチンごとに
わけてメインで呼び出そうと思ってます。
|
|