Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Dictonary Help

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,53369
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Dictonary Help
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Dictonary Help - 11/8/2007 12:54:57 AM   
  4scriptmoni


Posts: 208
Score: 0
Joined: 5/3/2007
Status: offline
I have a txt file with format: email@email.com ; 12312
But I have more then one of the same email and I am just trying to add the Count to print out a clean file.
I have no experience using dictonary, but I think it could help me.

Any help is very welcome



      

thx,

_____________________________

Enterprise Microsoft Scripts
Exchange, Login/Logout Monitor,TS, Monitoring, Security, AD, etc...
http://www.felipeferreira.net
 
 
Post #: 1
 
 RE: Dictonary Help - 11/8/2007 1:30:56 AM   
  ehvbs

 

Posts: 2200
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi 4scriptmoni,

given this input file:


      

this script:


      

creates this output file:

      

Good luck!

ehvbs

(in reply to 4scriptmoni)
 
 
Post #: 2
 
 RE: Dictonary Help - 11/8/2007 1:48:11 AM   
  4scriptmoni


Posts: 208
Score: 0
Joined: 5/3/2007
Status: offline
I knew I should be using this Dictonary stuff.
Amazing!
thanks ehvbs!


_____________________________

Enterprise Microsoft Scripts
Exchange, Login/Logout Monitor,TS, Monitoring, Security, AD, etc...
http://www.felipeferreira.net

(in reply to ehvbs)
 
 
Post #: 3
 
 RE: Dictonary Help - 11/8/2007 1:52:32 AM   
  ehvbs

 

Posts: 2200
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi 4scriptmoni,

you are welcome; just one question: why do you use " ; " instead of ";"
as separator? Could you (easily) change this?

Regards

ehvbs

< Message edited by ehvbs -- 11/8/2007 2:05:14 AM >

(in reply to 4scriptmoni)
 
 
Post #: 4
 
 RE: Dictonary Help - 11/8/2007 3:31:19 AM   
  4scriptmoni


Posts: 208
Score: 0
Joined: 5/3/2007
Status: offline
I did changed to ";"
now I am trying to sort the output. Geezz i didnt think it would be so dificult.
I even changed the output :
oTS.WriteLine dicSpam(sKey)& ";" & sKey
This way I get Numbers;email@asdas.com

I have read the whole thread about JSArray, have also tried it out but no success.
The sub you create "InsertionSort"  only sorted the first Char (1-9) but since I got bigger numbers it didnt work.
Any easy array functions out there, or maybe you could tweak yours?
thanks

_____________________________

Enterprise Microsoft Scripts
Exchange, Login/Logout Monitor,TS, Monitoring, Security, AD, etc...
http://www.felipeferreira.net

(in reply to ehvbs)
 
 
Post #: 5
 
 RE: Dictonary Help - 11/8/2007 3:44:14 AM   
  ehvbs

 

Posts: 2200
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi 4scriptmoni,

my question regarding the separator was caused by my assumption that after
you got the sums done, your boss would ask for sorting, filtering, ...
All such enhancement are possible, if you access your source file as a database
file (MS ODBC Text Driver).
Would you be interested in going the database way?

Regards

ehvbs

(in reply to 4scriptmoni)
 
 
Post #: 6
 
 RE: Dictonary Help - 11/8/2007 3:47:26 AM   
  4scriptmoni


Posts: 208
Score: 0
Joined: 5/3/2007
Status: offline
i am not planing to use DBs yet.
just sorting, outputing to txt (maybe just top 10) and then disable account and email report.

_____________________________

Enterprise Microsoft Scripts
Exchange, Login/Logout Monitor,TS, Monitoring, Security, AD, etc...
http://www.felipeferreira.net

(in reply to ehvbs)
 
 
Post #: 7
 
 RE: Dictonary Help - 11/8/2007 3:55:49 AM   
  ehvbs

 

Posts: 2200
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
But it could be easy:

this code:


      

needs a schema.ini file in .\spamlog


      

and the (changed) spamlog.txt in that folder:


      

Then you'll get:


      

Much ADO without much WORK!

ehvbs

PS. Forgot this function:


      

< Message edited by ehvbs -- 11/8/2007 4:01:47 AM >

(in reply to 4scriptmoni)
 
 
Post #: 8
 
 RE: Dictonary Help - 11/8/2007 11:17:41 PM   
  4scriptmoni


Posts: 208
Score: 0
Joined: 5/3/2007
Status: offline
yes I am now putting into .mdb file.
It will be easier to play with the data and make reports plus I will have records.
many thanks for the help, I will post all code once I get it working.
chhers

_____________________________

Enterprise Microsoft Scripts
Exchange, Login/Logout Monitor,TS, Monitoring, Security, AD, etc...
http://www.felipeferreira.net

(in reply to ehvbs)
 
 
Post #: 9
 
 RE: Dictonary Help - 11/12/2007 3:19:56 AM   
  4scriptmoni


Posts: 208
Score: 0
Joined: 5/3/2007
Status: offline
Here is the final work

http://www.visualbasicscript.com/tt.aspx?forumid=16

_____________________________

Enterprise Microsoft Scripts
Exchange, Login/Logout Monitor,TS, Monitoring, Security, AD, etc...
http://www.felipeferreira.net

(in reply to 4scriptmoni)
 
 
Post #: 10
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Dictonary Help Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts