here's a Q

May. 13th, 2005 11:04 pm
ceagle: (Default)
[personal profile] ceagle
...for you script-savvy folks:

This page http://www.microsoft.com/technet/scriptcenter/resources/qanda/apr05/hey0413.mspx contains some useful scripts for locating duplicate strings in a file, and leaves only one when finished processing.
My question is, how does one implement one of these?
I've installed Perl and CGI scripts on servers before, but this is for local files.

Does one simply put the script in the same folder with the target file and alter the script to "./targetfilename.txt" for input/output?
And how does onee actually set it to run... does one need to use a compiler or DOS app, and if on Mac, can this run as an AppleScript?

thanks in advance ^v^ ...

Date: 2005-05-14 06:58 am (UTC)
From: [identity profile] bride.livejournal.com
Hi, I saw your post in my FriendsFriends =)

You need to pull up a Windows command window and, at the prompt, type "cscript //H:CScript" to change the script host to CScript (commandline, no GUI widgets).

Then, type "wscript". In the pop-up window that comes up, unselect the box for "Display logo when ..."

Copy the list of names into a file and call it whatever you like.

Copy the script text and put it into a file with a .vbs extension. Edit line 7 of the .vbs file to be the absolute path of the names file (you could pass the file name in as a commandline parametre once you get going on this =)

Back at the prompt, type the name of the script file with or without the .vbs extension. It should spit out to STDOUT a list of names with no duplications.

'>' to redirect the output to a file works in Windows as well =)

You could put all your .vbs files in a bin folder anywhere and add it to the Path variable in your environment variables. Right-click on "My Computer", go to "Properties", Advanced tab, Environment variables, System Variables, and add it to the end of the "Path" variable.

I very highly recommend installing the "Open Command Window Here" PowerToy - from here (http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx) if you don't have it already. In Windows Explorer, right-click on any folder and go to "Command Prompt Here" and you'll get a Windows shell opened to that directory so you don't have to cd everywhere, get the name wrong, forget the quotes around the dir names with spaces, etc.

And lastly... get Cygwin and ActivePerl instead. >KO =)

wonderfuls!

Date: 2005-05-14 08:58 am (UTC)
From: [identity profile] c-eagle.livejournal.com
Wow.... LOTS of great help... THANK YOU!
*winghugs* ^v^

Date: 2005-05-14 08:45 am (UTC)
From: [identity profile] chrissawyer.livejournal.com
Heya, want to arrange to pick up your check?

Or if you want to e-mail with a mailing addy, that would be fine. :)

Date: 2005-05-14 09:01 am (UTC)
From: [identity profile] c-eagle.livejournal.com
Hiya critter!
Hey, no worries... appreciate that muchly.. ^v^ ...Be more'n happy ta pick it up in person though... it'll be great ta see ya again, would've earlier 'cept it's been lots of late evenings this week... some time in the next few days awright?

Profile

ceagle: (Default)
ceagle

December 2025

S M T W T F S
 123456
78910111213
14151617181920
21222324252627
282930 31   

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 12th, 2026 06:19 am
Powered by Dreamwidth Studios