Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

Scripting Question...

Oct 1, 2007 12:12AM PDT

I was wondering if anyone could help me with a scripting question. I have a .txt file that contains a list of usernames. We'll call this .txt file users.txt I want to have a batch file that interrogates this .txt file and pulls every unique username one time and outputs it to a file. Any idears?

Here's an example of what user.txt looks like:
bouzzia
vandyrb
burlakl
burlakl
roberts
bouzzia

Here's what I want the output file to look like after running the script:
bouzzia
vandyrb
burlakl
roberts

Discussion is locked

- Collapse -
You may need something more...
Oct 1, 2007 12:28AM PDT

Than just a script to do this. If you can use Visual Basic or C++ then this becomes rather easy to resolve as you just build up a list of the unique names and then dump that out to a file. Using just a script may be a bit tricky. There is also the question of how optimized do you want the solution to be.

Regards,
JB

- Collapse -
Zero programming. No script required. Here it is!
Oct 1, 2007 3:51AM PDT