|
-
Oct 9th, 2007, 01:24 PM
#1
Thread Starter
Member
[RESOLVED] [2005] How to remove from each line
Lets say I have a text file that has 30 to 40 lines in it. Each line looks something like this:
2019562.121 * The dude walked the dog 10 times
how would I remove everything before the asterisk in each line?
Thanks for any help
My Languages: English, VB 2005, Perl
My Hobbies: Code, Photoshop, Skateboarding, Video Games, Flying, Cars(modification), Airbrushing, Electronic music DJing, and production.
-
Oct 9th, 2007, 01:38 PM
#2
Re: [2005] How to remove from each line
As you loop through file, you can read each line into a string variable and then
strx.Substring(strx.IndexOf("*") + 1)
-
Oct 9th, 2007, 01:53 PM
#3
Thread Starter
Member
Re: [2005] How to remove from each line
thanks, as soon as I wrote this post I realized I could just do this:
Code:
Dim text As String
Dim oread As IO.StreamReader
oread = IO.File.OpenText("blahblahblah.txt")
Dim textcut As String
While oread.Peek <> -1
text = oread.ReadLine
textcut = text.Remove(0, 15)
txt2.Text = txt2.Text & vbCrLf & textcut
End While
My Languages: English, VB 2005, Perl
My Hobbies: Code, Photoshop, Skateboarding, Video Games, Flying, Cars(modification), Airbrushing, Electronic music DJing, and production.
-
Oct 9th, 2007, 01:59 PM
#4
Re: [RESOLVED] [2005] How to remove from each line
Yeah, simple solutions are the best.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|