|
-
August 15th, 2001, 04:59 AM
#1
i need an idea how to..
i have TXT file that contains all the IP's of the users that r on my FTP..(at real time)..so i want to do a program that will delete all the same IP's..
for example my list is:
212.123.321.123
212.234.123.121
212.123.321.123
so i want it to be:
212.234.123.121
-
August 15th, 2001, 10:38 AM
#2
Re: i need an idea how to..
Delete from where? From the file? It's impossible. What you can do is to create another new file without those IP's OR rewrite your existing file completely.
So. Create an array and read your IP's line by line and enter them into the array. But before entering each one you should check if such IP already exists in your array. If so - just erase that element of the array.
At the end write all not empty elements of your array to the file.
PS. You can use a chain instead of an array - whatever you like better.
-
August 15th, 2001, 12:09 PM
#3
Re: i need an idea how to..
can u give me an expmle...of how to do all this?
-
August 15th, 2001, 01:16 PM
#4
Re: i need an idea how to..
Yes, I can. But I won't!
Firstly, I have to write and test that example before I can give it to you.
Secondly, you can do it by yourself, because it's very easy to do even for a beginner. So, it means you're lazy and that is not my problem.
And finally, I haven't seen you ever rate anybody from those who gave you helpful answers to your previous questions.
So, as you can see I have no single reason to waste my time with an example for you.
That's it, buddy.
-
August 15th, 2001, 01:39 PM
#5
Re: i need an idea how to..
Way to go man. Exellent answer!
Iouri Boutchkine
[email protected]
-
August 15th, 2001, 01:40 PM
#6
Re: i need an idea how to..
Hi there,
Just out of curiousity... in that post you mentioned using a chain or an array depending on preference. I just haven't heard the term chain used before and I was wondering if you mean something like a Linked List or Collection. Thanks!
Jeff
-
August 15th, 2001, 01:59 PM
#7
Re: i need an idea how to..
Yeah, sorry. That is definitely linked list what I meant.
Artefacts from my background. :-)
-
August 15th, 2001, 02:01 PM
#8
Re: i need an idea how to..
Haha, thanks! 
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
|