none
Starting to Program RRS feed

  • Question

  • I am trying to learn programming to develop a new skill set and automate repetitive task.  For my first program I would like to gather some statistics (using vba, or vb) from an application log file.  Could some one help me out to get started.  I have no clue.
    • Moved by litdev Tuesday, January 24, 2012 8:48 PM (From:Small Basic)
    Tuesday, January 24, 2012 8:18 PM

Answers

  • This sounds quite easy in Excel VBA. Record (in Excel) you manually opening the log file in Excel, then filtering the data you want and creating the stats. Then look in msdn.microsoft.com for OLEDB VBA code for writing data to SQL Server or Access.

    I strongly recommend getting a book on Excel VBA to get you started. From Excel VBA you can them progress to Acces, Word, Proejct VBA ext or onwards and upwards to VB.Net.


    Rod Gill

    The one and only Project VBA Book Rod Gill Project Management
    Sunday, February 5, 2012 2:48 AM
  • Thanks for the response...

    Well I have tried to filter the data but it isn't working.  I have a the Excel VBA book for user which I am reading to see what I need to do.  I have successfully been able to read the file and list it in a list box.  I guess that is a good start.  My next step will be trying to loop through the log file to extract the information needed and then post that in excel.

    Tuesday, February 14, 2012 2:25 PM

All replies

  • I think you need to buy a book or two to help you. As it is we have no idea of what you do or don't know so it's very hard to help you. If you post specific problems we are very happy to help.

     

    For example to open a text log file, search help for teh VBA command Open.


    Rod Gill

    The one and only Project VBA Book Rod Gill Project Management
    Wednesday, January 25, 2012 7:26 AM
  • Hi DLiv,

    There are several ways to read data from Text files, a couple of ways you can find in below threads:

    http://msdn.microsoft.com/en-us/library/dd439413%28v=office.12%29.aspx

    http://vbadud.blogspot.com/2007/06/vba-read-text-files-with-leading.html

     

    As Rod mentioned you need to specify a bit more, to help you better.

     

    Hope this helps,

     


    Daniel van den Berg | Washington, USA | "Anticipate the difficult by managing the easy"
    Friday, January 27, 2012 7:28 PM
    Moderator
  • OK to be more specific I am trying to gather some statistics from my application log file.   The file has specific information that I want to capture for each job that runs.  It also has a start point an end point that distinguish the jobs for one another.  In addition the job can run multiple times in a given time period.  I would like to gather the information at the end of the day and create a statistical chart the shows the job, how many reports per job, start and stop times, etc. 

    I know I would have ingest the file for the previous day and gather the statistics.

    I would have to read the whole file

    I would have to loop only through the job and gather the required information.

    Then I would want to upload this informtation to a database for historical reporting (month, quarterly, yearly, etc).

    I would want to provide the statistics to management for the previous work day.

    I would like this information to be available via the web.

    I know this sounds ambitious for a beginner but this is what I would like to accomplish in the long term.  The short term would be to just capture the information and put it in an excel spread sheet.  Obviously my option would be to save the log files to a separate location so that I could have some history before I would capture the information in a data base. 

    This is my goal :)

    Friday, February 3, 2012 8:58 PM
  • OK to be more specific I am trying to gather some statistics from my application log file.   The file has specific information that I want to capture for each job that runs.  It also has a start point an end point that distinguish the jobs for one another.  In addition the job can run multiple times in a given time period.  I would like to gather the information at the end of the day and create a statistical chart the shows the job, how many reports per job, start and stop times, etc. 

    I know I would have ingest the file for the previous day and gather the statistics.

    I would have to read the whole file

    I would have to loop only through the job and gather the required information.

    Then I would want to upload this informtation to a database for historical reporting (month, quarterly, yearly, etc).

    I would want to provide the statistics to management for the previous work day.

    I would like this information to be available via the web.

    I know this sounds ambitious for a beginner but this is what I would like to accomplish in the long term.  The short term would be to just capture the information and put it in an excel spread sheet.  Obviously my option would be to save the log files to a separate location so that I could have some history before I would capture the information in a data base. 

    This is my goal :)

    Friday, February 3, 2012 8:58 PM
  • This sounds quite easy in Excel VBA. Record (in Excel) you manually opening the log file in Excel, then filtering the data you want and creating the stats. Then look in msdn.microsoft.com for OLEDB VBA code for writing data to SQL Server or Access.

    I strongly recommend getting a book on Excel VBA to get you started. From Excel VBA you can them progress to Acces, Word, Proejct VBA ext or onwards and upwards to VB.Net.


    Rod Gill

    The one and only Project VBA Book Rod Gill Project Management
    Sunday, February 5, 2012 2:48 AM
  • Thanks for the response...

    Well I have tried to filter the data but it isn't working.  I have a the Excel VBA book for user which I am reading to see what I need to do.  I have successfully been able to read the file and list it in a list box.  I guess that is a good start.  My next step will be trying to loop through the log file to extract the information needed and then post that in excel.

    Tuesday, February 14, 2012 2:25 PM