моя строка
как мне ее удалить из файла
моя строка
Dim S$, Arr$(), I&
Open "C:\MyFile.txt" For Input As #1
S = Input(LOF(1), 1)
Close #1
Arr = Split(S, vbCrLf)
For I = LBound(Arr) To UBound(Arr)
If Left(Arr(I), Len("моя строка")) = "моя строка" Then Arr(I) = ""
Next
S = ""
For I = LBound(Arr) To UBound(Arr)
If Arr(I) <> "" Then S = S & Arr(I) & vbCrLf
Next
S = Left(S, Len(S) - 1)
Open "C:\MyFile.txt" For Output As #1
Print #1, S
Close #1
Dim myArr() As String
Dim arVal As Integer
Private Sub Form_Load()
arVal = 0
Open "c:\1.txt" For Input As #1
Do Until EOF(1)
Line Input #1, t
tt = tt + t & vbCrLf
arVal = arVal + 1
Loop
Close #1
ReDim myArr(0 To arVal)
arVal = 0
Open "c:\1.txt" For Input As #1
Do Until EOF(1)
Line Input #1, w
myArr(arVal) = w
arVal = arVal + 1
Loop
For e = 0 To arVal
If myArr(e) = "Text1" Then
myArr(e) = "FuckIt"
End If
Next
For q = 0 To arVal
Text1.Text = Text1.Text & myArr(q) & vbCrLf
Next
End Sub
Dim FN1 As Integer, FN2 As Integer, S As String
FN1 = FreeFile
Open "file1.txt" For Input As #FN1
FN2 = FreeFile
Open "~file" For Output As #FN2
While Not EOF(FN1)
Line Input #FN1, S
Select Case S
Case "Tag String"
Case Else
Print #FN2, S
End Select
Wend
Close #FN1, #FN2
Kill "file1.txt"
Name "~file" As "file1.txt"
Сейчас этот форум просматривают: Google-бот, SemrushBot и гости: 16