Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. searching from a text file

searching from a text file

Scheduled Pinned Locked Moved Visual Basic
helptutorialquestioncsharp
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MagicGirL83
    wrote on last edited by
    #1

    hi.. i'd like to ask how can i read and search the contents of a log file from a remote computer? i've attached a sample log file and i want to search for "warning" or "critical error" based on the current date and time.. and i will display on a web page the next lines of it.. until it sees a blank space right next to the time stamp. any idea how to do that in vb.net? hope you can help me.. thanks.. what do i have to use? here's an example from the text file: ################################################################################################### 11/27/04 17:47:14:LOG FILE: D:\ORACLE\ADMIN\log\oramon_marsprod.log LEVEL: 1 PID: 1404 ################################################################################################### 11/27/04 17:47:14:************** ORAMON version: 1.0.6 (build: Jan, 28, 2003) ************* 11/27/04 17:49:15:ERROR#************* MONITOR: archive_dir_space ************** 11/27/04 17:49:15:ERROR#'(%PCT_FREE% >= 10 and %PCT_FREE% < 25)' (evaluated: '(15.8708639888514 >= 10 and 15.8708639888514 < 25)') is violated. 11/27/04 17:49:15:ERROR# DIR_NAME: Y:\oracle\MARS\archive 11/27/04 17:49:15:ERROR# TOTAL_BYTES: 65032785920 11/27/04 17:49:15:ERROR# FREE_BYTES: 12268359680 11/27/04 17:49:15:ERROR# PCT_FREE: 15.8708639888514 11/27/04 17:49:15:ERROR#**** Skipping mail for 'Y:\oracle\MARS\archive@1' 11/27/04 17:49:15:ERROR#***** The following mail will not be delivered 11/27/04 17:49:15:ERROR#Archive Directory: Y:\oracle\MARS\archive has low disk-space (TOTAL: 65032785920 bytes, FREE: 12268359680 bytes, 15.8708639888514 %free). Please make sure that ORABCK is running on the machine and other system files are not using an increased amount of space. 11/27/04 17:49:15:Evaluating pcond=> (15.8708639888514 < 2) 11/27/04 18:39:16:ERROR#************* MONITOR: ora_parameter ************** 11/27/04 18:39:16:ERROR#'('%PARAM_NAME%' ne 'open_cursors' and %PARAM_PCT_FREE% >= 6 and %PARAM_PCT_FREE% < 21)' (evaluated: '('db_files' ne 'open_cursors' and 19 >= 6 and 19 < 21)') is violated. 11/27/04 18:39:16:ERROR# PARAM_NAME: db_files 11/27/04 18:39:16:ERROR# ID: 11/27/04 18:39:16:ERROR# PARAM_CUR_VALUE: 205 11/27/04 18:39:16:ERROR# PARAM_MAX_VALUE: 256 11/27/04 18:39:16:ERROR# PARAM_PCT_FREE: 19 11/27/04 18:39:16:ERROR#**** Skipping mail for 'db_files@1' 11/27/04 18:39:16:ERROR#***** The following mail will not be delivered 11/27/04 18:39:16:ERROR#'db_files' init.ora parameter (current: 205, max: 256) has low resource free%: 19. This is a symptom of incorrect init.o

    C 1 Reply Last reply
    0
    • M MagicGirL83

      hi.. i'd like to ask how can i read and search the contents of a log file from a remote computer? i've attached a sample log file and i want to search for "warning" or "critical error" based on the current date and time.. and i will display on a web page the next lines of it.. until it sees a blank space right next to the time stamp. any idea how to do that in vb.net? hope you can help me.. thanks.. what do i have to use? here's an example from the text file: ################################################################################################### 11/27/04 17:47:14:LOG FILE: D:\ORACLE\ADMIN\log\oramon_marsprod.log LEVEL: 1 PID: 1404 ################################################################################################### 11/27/04 17:47:14:************** ORAMON version: 1.0.6 (build: Jan, 28, 2003) ************* 11/27/04 17:49:15:ERROR#************* MONITOR: archive_dir_space ************** 11/27/04 17:49:15:ERROR#'(%PCT_FREE% >= 10 and %PCT_FREE% < 25)' (evaluated: '(15.8708639888514 >= 10 and 15.8708639888514 < 25)') is violated. 11/27/04 17:49:15:ERROR# DIR_NAME: Y:\oracle\MARS\archive 11/27/04 17:49:15:ERROR# TOTAL_BYTES: 65032785920 11/27/04 17:49:15:ERROR# FREE_BYTES: 12268359680 11/27/04 17:49:15:ERROR# PCT_FREE: 15.8708639888514 11/27/04 17:49:15:ERROR#**** Skipping mail for 'Y:\oracle\MARS\archive@1' 11/27/04 17:49:15:ERROR#***** The following mail will not be delivered 11/27/04 17:49:15:ERROR#Archive Directory: Y:\oracle\MARS\archive has low disk-space (TOTAL: 65032785920 bytes, FREE: 12268359680 bytes, 15.8708639888514 %free). Please make sure that ORABCK is running on the machine and other system files are not using an increased amount of space. 11/27/04 17:49:15:Evaluating pcond=> (15.8708639888514 < 2) 11/27/04 18:39:16:ERROR#************* MONITOR: ora_parameter ************** 11/27/04 18:39:16:ERROR#'('%PARAM_NAME%' ne 'open_cursors' and %PARAM_PCT_FREE% >= 6 and %PARAM_PCT_FREE% < 21)' (evaluated: '('db_files' ne 'open_cursors' and 19 >= 6 and 19 < 21)') is violated. 11/27/04 18:39:16:ERROR# PARAM_NAME: db_files 11/27/04 18:39:16:ERROR# ID: 11/27/04 18:39:16:ERROR# PARAM_CUR_VALUE: 205 11/27/04 18:39:16:ERROR# PARAM_MAX_VALUE: 256 11/27/04 18:39:16:ERROR# PARAM_PCT_FREE: 19 11/27/04 18:39:16:ERROR#**** Skipping mail for 'db_files@1' 11/27/04 18:39:16:ERROR#***** The following mail will not be delivered 11/27/04 18:39:16:ERROR#'db_files' init.ora parameter (current: 205, max: 256) has low resource free%: 19. This is a symptom of incorrect init.o

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I'd imagine that you'd use regular expressions to capture the text you need. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

      M 1 Reply Last reply
      0
      • C Christian Graus

        I'd imagine that you'd use regular expressions to capture the text you need. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

        M Offline
        M Offline
        MagicGirL83
        wrote on last edited by
        #3

        hi..what are regular expressions? i'd like to extract the lines between the warning or critical error and the line before the blank space after the time stamp

        C 1 Reply Last reply
        0
        • M MagicGirL83

          hi..what are regular expressions? i'd like to extract the lines between the warning or critical error and the line before the blank space after the time stamp

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          Google is your friend. MSDN also has a lot of info on regular expressions. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups