2ch電光掲示板(仮)

このエントリーをはてなブックマークに追加
840VBS厨房
Set FS = CreateObject("Scripting.FileSystemObject")
If WScript.Arguments.Count = 1 Then
a = WScript.Arguments(0)
If FS.FileExists(a) Then
niden = FS.GetFile(Wscript.ScriptFullName).ParentFolder.Path & "\board.lst"
Set F0 = FS.OpenTextFile(a,1)
Set F1 = FS.CreateTextFile(niden,True)
While Not F0.AtEndOfStream
t = F0.ReadLine
If Left(t,1) <> Chr(9) Then
c = token(t,1)
Else
s = token(t,2)
d = token(t,3)
b = token(t,4)
If LenB(c) <= 16 And LenB(b) <= 27 And LenB(d) <= 11 Then
F1.WriteLine c & "," & b & "," & s & "," & d
End If
End If
Wend
F1.Close
F0.Close
MsgBox niden & "を作成しました"
Else
MsgBox "ファイルが無い"
End If
Else
MsgBox "2channel.brdをドロップしてね"
End If
841VBS厨房:01/09/24 03:47
Function token(s,n)
Dim p,q
p = 1
q = 0
Do While (p <= Len(s))
n = n-1
q = InStr(p,s,Chr(9))
If n = 0 Or q = 0 Then Exit Do
p = q+1
Loop
If q = 0 Then
token = Mid(s,p)
Else
token = Mid(s,p,q-p)
End If
End Function