Bigbadborris
Active member
- Joined
- Aug 21, 2013
- Messages
- 35
- Programming Experience
- Beginner
HI
Me again
I am trying to remove the first 7 characters every line of a text file.
I have this code so far
Dim FILE_NAME AsString = "C:\DRITXT\TRADE.txt"
Dim FILE_NAMEOUT AsString = "C:\DRITXT\TRADE2.txt"
Dim TextLine AsString
Dim TextTrim AsString
Dim objReader AsNew System.IO.StreamReader(FILE_NAME)
DoWhile objReader.Peek() <> -1
TextLine = TextLine & objReader.ReadLine() & vbNewLine
TextTrim = TextLine.Remove(0, 7)
Dim objWriter AsNew System.IO.StreamWriter(FILE_NAMEOUT)
objWriter.WriteLine(TextTrim)
objWriter.Close()
Loop
The problem is this only removes the first 7 characters from the first line only.
Can someone tell me where I am going wrong
Many Thanks
Me again
I am trying to remove the first 7 characters every line of a text file.
I have this code so far
Dim FILE_NAME AsString = "C:\DRITXT\TRADE.txt"
Dim FILE_NAMEOUT AsString = "C:\DRITXT\TRADE2.txt"
Dim TextLine AsString
Dim TextTrim AsString
Dim objReader AsNew System.IO.StreamReader(FILE_NAME)
DoWhile objReader.Peek() <> -1
TextLine = TextLine & objReader.ReadLine() & vbNewLine
TextTrim = TextLine.Remove(0, 7)
Dim objWriter AsNew System.IO.StreamWriter(FILE_NAMEOUT)
objWriter.WriteLine(TextTrim)
objWriter.Close()
Loop
The problem is this only removes the first 7 characters from the first line only.
Can someone tell me where I am going wrong
Many Thanks