Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 22nd, 2005, 05:06 PM
werD's Avatar
werD werD is offline
Certified Abuser
ASP Free Beginner (1000 - 1499 posts)
 
Join Date: Jan 2005
Location: Line 73 ---^
Posts: 1,046 werD User rank is First Lieutenant (10000 - 20000 Reputation Level)werD User rank is First Lieutenant (10000 - 20000 Reputation Level)werD User rank is First Lieutenant (10000 - 20000 Reputation Level)werD User rank is First Lieutenant (10000 - 20000 Reputation Level)werD User rank is First Lieutenant (10000 - 20000 Reputation Level)werD User rank is First Lieutenant (10000 - 20000 Reputation Level)werD User rank is First Lieutenant (10000 - 20000 Reputation Level)werD User rank is First Lieutenant (10000 - 20000 Reputation Level)  Folding Points: 20652 Folding Title: Starter FolderFolding Points: 20652 Folding Title: Starter Folder
Time spent in forums: 1 Week 4 Days 20 h 37 m 12 sec
Reputation Power: 127
Loop through Text File -Find String - Delete Line

Hey all
Im having some trouble with a VB script and was told this is the place to go for help.


What I have is an IIS log that I would like to alter for an easier report for my Sup's to view.
It looks like this below
Code:
2005-03-21 00:00:38 10.150.111.111 - 10.150.111.111 80 GET /robohelp/SHPSMATE/SHPSMATE+v3/news.asp - 304 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1)

 


The problem is this page is set to refresh once a minute and is used by about 1000 people so my log is just overrun with it. What I would like to do is run a VB script that will open the file(its been converted to a text file) loop through it searching for a string that contains "news.asp" regardless of the time or IP connecting and then delete that entire string out of the file

Problem is Im a little lost Ive been reading up and found that InStr option will be little help and everyone seems to be pointing me to a VB option

does anyone have a good idea on how I could start this out
Thanks a bunch in advance for any help

Reply With Quote
  #2  
Old March 22nd, 2005, 07:39 PM
werD's Avatar
werD werD is offline
Certified Abuser
ASP Free Beginner (1000 - 1499 posts)
 
Join Date: Jan 2005
Location: Line 73 ---^
Posts: 1,046 werD User rank is First Lieutenant (10000 - 20000 Reputation Level)werD User rank is First Lieutenant (10000 - 20000 Reputation Level)werD User rank is First Lieutenant (10000 - 20000 Reputation Level)werD User rank is First Lieutenant (10000 - 20000 Reputation Level)werD User rank is First Lieutenant (10000 - 20000 Reputation Level)werD User rank is First Lieutenant (10000 - 20000 Reputation Level)werD User rank is First Lieutenant (10000 - 20000 Reputation Level)werD User rank is First Lieutenant (10000 - 20000 Reputation Level)  Folding Points: 20652 Folding Title: Starter FolderFolding Points: 20652 Folding Title: Starter Folder
Time spent in forums: 1 Week 4 Days 20 h 37 m 12 sec
Reputation Power: 127
Open .log file with notepad to save as text(or just rename it)
Open .txt file with wordpad and save as rich text format(.rtf)
Open With word and hit "ctrl+F" and got to replace tab
copy example string and paste in find box
To eliminate all lines regarding a certain file regardless of the user or time I did this
Code:
Instead of
2005-03-21 00:00:38 10.150.111.111 - 10.150.111.111 80 GET /robohelp/SHPSMATE/SHPSMATE+v3/news.asp - 304 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1)
 
I used
2005-03-21 ^#^#:^#^#:^#^# 10.150.^#^#^#.^#^#^# - 10.150.111.111 80 GET /robohelp/SHPSMATE/SHPSMATE+v3/news.asp - 304 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1)

"^#" means any number "^?" means any character 
 

 

Save
open in wordpad save as .txt
rename to .log
good stuff


This is totally Office relevant and is Used with IIS Logs but its an easy find and replace

Like I said any other suggestions would be appreciated

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Loop through Text File -Find String - Delete Line


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT