B
Bre-x
Hi,
I need to open a text file
if my code finds on the 3 Line (Always the 3 Line)
the text "(FN-", I need to replace it with "(FX-"
if the finds something else
I need to insert a line after the 2 and enter "(FX-"
Is there a way to do this?
Function insert_fnpath()
Dim fso As New Scripting.FileSystemObject
Dim thepath As String
Dim ftext
Dim ntext
thepath = "N:\1CNC\DATA\625\FISCON0100\6252018.txt"
Set ftext = fspenTextFile(thepath, ForReading)
x = ftext.ReadLine
ftext.SkipLine
x = ftext.Read(4)
ftext.Close
Select Case x
Case "(FN-"
'Overwrite line with "(FX-)
Case Else
'Insert New Line after Line 2
End Select
Set fso = Nothing
end Function
I need to open a text file
if my code finds on the 3 Line (Always the 3 Line)
the text "(FN-", I need to replace it with "(FX-"
if the finds something else
I need to insert a line after the 2 and enter "(FX-"
Is there a way to do this?
Function insert_fnpath()
Dim fso As New Scripting.FileSystemObject
Dim thepath As String
Dim ftext
Dim ntext
thepath = "N:\1CNC\DATA\625\FISCON0100\6252018.txt"
Set ftext = fspenTextFile(thepath, ForReading)
x = ftext.ReadLine
ftext.SkipLine
x = ftext.Read(4)
ftext.Close
Select Case x
Case "(FN-"
'Overwrite line with "(FX-)
Case Else
'Insert New Line after Line 2
End Select
Set fso = Nothing
end Function