Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 14th, 2003, 06:20 PM
maclam2000 maclam2000 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 2 maclam2000 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Post Finding a line in a file and deleting it.

Please Help Me.
I need to loacate a user in a file and remove that user without harming the rest of the file.

Can Anyone Help ME?

Reply With Quote
  #2  
Old August 15th, 2003, 04:33 AM
sir_drinxalot's Avatar
sir_drinxalot sir_drinxalot is offline
Known to taste like chicken
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: In front of my computer
Posts: 228 sir_drinxalot User rank is Sergeant (500 - 2000 Reputation Level)sir_drinxalot User rank is Sergeant (500 - 2000 Reputation Level)sir_drinxalot User rank is Sergeant (500 - 2000 Reputation Level)sir_drinxalot User rank is Sergeant (500 - 2000 Reputation Level)sir_drinxalot User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 13 h 59 m 40 sec
Reputation Power: 19
Send a message via MSN to sir_drinxalot
Facebook
im not that great at VB, but i do know a little bit so i will TRY help you. I beleive you can do a loop and search for a specific line of text, and i think the coding is something like this:

Code:
Dim a as string  'Declaring variable to temporarily store data, where a is the varible name
Open filename.txt for random as #1 'open file as "random" to allow read and write
Do until EOF(1) 'start loop to find what you are looking for


After that i seem to kep confusing myself, i'll keep thinking of how to do it, if i get anywhere i'll let you know.
__________________
"Operator, Give me the number for 911" - Homer J Simpson
JonnoWalmsley.com
vv Latest Image vv

Last edited by sir_drinxalot : August 15th, 2003 at 04:36 AM.

Reply With Quote
  #3  
Old August 15th, 2003, 07:44 AM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,840 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 2 Days 20 m 5 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
If you built the file with get then you can use put to erase the record in question, but to do so you will have to put spaces in the place of the record. The other option that I know of would be to read the file in and re-write the file minus the record in question.

Reply With Quote
  #4  
Old August 15th, 2003, 12:53 PM
maclam2000 maclam2000 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 2 maclam2000 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks I Got It Now

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Finding a line in a file and deleting it.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway