|
-
Oct 21st, 2007, 03:29 AM
#1
Thread Starter
New Member
Deleting sentences in text files
How do you only delete certain parts/lines/sentences in a text file?
-
Oct 21st, 2007, 03:33 AM
#2
Frenzied Member
Re: Deleting sentences in text files
Hi larzi,
Take a look here
It's a useful site to do with string manipulation.
About half way down the page is:
Delete a substring from a string
Hope this helps
-
Oct 21st, 2007, 03:45 AM
#3
Thread Starter
New Member
Re: Deleting sentences in text files
Thanks for that, that'll help alot. I'll rate you as a good helper
-
Oct 21st, 2007, 03:54 AM
#4
Frenzied Member
Re: Deleting sentences in text files
Your welcome 
Thanks for the rating.
If you get stuck, post back here.
If it's sorted out then mark this thread Resolved, using the 'Thread Tool' menu option above please.
-
Oct 21st, 2007, 06:31 AM
#5
Re: Deleting sentences in text files
I usually import text files into a text box and do my editing that way. It is easier (at least I think) and does not require a whole lot of code (which is always good. )
-
Oct 21st, 2007, 06:51 PM
#6
Thread Starter
New Member
Re: Deleting sentences in text files
Okay, so how do you do that?
-
Oct 22nd, 2007, 05:39 AM
#7
Re: Deleting sentences in text files
Make sure the textbox is set to multline and you have scroll bars
vb Code:
'Replace 'c:\larzi.txt' with the file you want to load to the TextBox
Open "c:\larzi.txt" For Input As #1
Text1.Text = Input(LOF(1), #1)
Close #1
'to save it back to your text file, first, delete the existing one
Kill "c:\larzi.txt"
'now create a new one
Open "c:\larzi.txt" For Append As #1
Print #1, Text1.Text
Close #1
End Sub
-
Oct 24th, 2007, 07:23 AM
#8
Thread Starter
New Member
Re: Deleting sentences in text files
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
|