text line removal
Author |
Message |
diqua
![](http://upload.wikimedia.org/wikipedia/en/5/50/Calvin_%26_Hobbes_-_Calvin.png)
|
Posted: Thu May 12, 2005 1:35 pm Post subject: text line removal |
|
|
is there a way i can remove a line from a single text file
any help will be greatly appreciated |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
betaflye
|
Posted: Tue May 17, 2005 6:42 pm Post subject: (No subject) |
|
|
VB 6 or VB Classic Here's some psuedo code to do what you want.
Dim iFileIn as Integer, iFileOut as Integer, strReadLine as String
iFileIn = FreeFile()
Open "Path\input.txt" for Input As #iFileIn
iFileOut = FreeFile()
Open "Path\output.txt" for Output as #iFileOut
Do while not EOF (iFileIn)
Line Input #iFileIn, strReadLine
if strReadLine <> line you want removed then
Write #iFileOut, strReadLine
end if
Loop
Kill "Path\input.txt"
Name "Path\output.txt" As "Path\input.txt
If you need a .Net example just ask ![Smile Smile](images/smiles/icon_smile.gif) |
|
|
|
|
![](images/spacer.gif) |
|
|