1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| Public Sub ImportAMF(ByVal strFullPath As String)
Dim strOutPath As String
Dim f1 As Integer, f2 As Integer
Dim tmp() As String, sTemp As String
Dim rec() As String
Dim i As Integer, j As Integer
strOutPath = Left(strFullPath, Len(strFullPath) - 4) & " ok.txt"
Reset
f1 = FreeFile
Open strFullPath For Input As #f1
f2 = FreeFile
Open strOutPath For Output As #f2
Line Input #f1, sTemp
sTemp = Replace(sTemp, " ", " ")
sTemp = Replace(sTemp, Chr(160), " ")
tmp = Split(sTemp, "</option><option>")
For i = 0 To UBound(tmp)
tmp(i) = Replace(tmp(i), "<option>", vbNullString)
tmp(i) = Replace(tmp(i), "</option>", vbNullString)
rec = Split(tmp(i), "|")
For j = 0 To UBound(rec)
rec(j) = Trim(rec(j))
Next j
tmp(i) = Join(rec, ";")
Print #f2, tmp(i)
Next i
Reset
End Sub |
Partager