Click to See Complete Forum and Search --> : i need an idea how to..
ma622
August 15th, 2001, 04:59 AM
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
Andrew R.
August 15th, 2001, 10:38 AM
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.
ma622
August 15th, 2001, 12:09 PM
can u give me an expmle...of how to do all this?
Andrew R.
August 15th, 2001, 01:16 PM
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.
Iouri
August 15th, 2001, 01:39 PM
Way to go man. Exellent answer!
Iouri Boutchkine
iouri@hotsheet.com
Ghost308
August 15th, 2001, 01:40 PM
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
Andrew R.
August 15th, 2001, 01:59 PM
Yeah, sorry. That is definitely linked list what I meant.
Artefacts from my background. :-)
Ghost308
August 15th, 2001, 02:01 PM
Haha, thanks! :)
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.