Click to See Complete Forum and Search --> : VI question?????


Huggy
10-10-2001, 06:47 PM
Here is the deal.
I have a long file with names oh about 979 names each on their own line.
The problem is there are some names in there two or three times which I do not need. How do I point these names out and delete them, so they are only in there once. Using VI command line type of deal. :confused:

slacker_x
10-10-2001, 07:07 PM
I have no idea how to do what you described in vi. If I had to do something like that, I would just write something up in Perl. It would do this:
- read line 1
- write line 1 to modified_file
- replace every instance of that line with nothing
- read line 2
- replace every instance of that line with nothing
.....

one you are done reading the original file, you should have one copy of every name in the new file.

Huggy
10-10-2001, 09:06 PM
ok and I know nothing about Perl.
:rolleyes:

could someone give me a little head or show me the path?

Strike
10-10-2001, 10:18 PM
I could whip up some sort of shell script if I had a few sample lines.