What’s Log Parser?

As mentioned before in the Profitability Keyword Post, there are several databases you can use to import CSV files. This method is effective, but somewhat clunky to import your CSV, then write the SQL queries you want. If importing is not an issue, programs such as Excel, Base, or MS Access are limited to a relatively small, maximum file size.



A better approach would be to use something that is installed directly on your Windows computer, which runs much more efficient than say XAMPP web server from a thumb drive. Log Parser 2.2 gets the most recommendations from internet reviewers for parsing CSV data, which is typically the tool of choice for many administrators that use the windows operating system.

Log Parser has not been updated since 2005, but don’t let that stop you. I just installed it on Windows 7, 64 bit, selected the complete version and it runs pretty well. In addition to Log Parser, I’ve also installed a free, front end GUI (graphical user interface) named Log Parser Lizard, which makes Log Parser simpler to use. There are a couple of other GUI’s available such as visual log parser, and log parser studio, but Log Parser Lizard seems to be the winner right now.

There are many web tutorials on how to use Log Parser 2.2 from the command line, and it can be fun to mess around with MS-DOS, but to make things easier for you, use Log Parser Lizard.
However, if you have some time to burn, you can learn how to execute the program through the command line with SQL queries:

Need query examples? Try here

For those new to windows shell, changing the directory to where the program executes may be difficult to understand. Most programs are coded for the user to simply push a button and automatically execute the code behind the scenes. As shown @ 12m54s in the video, make DOS easier to use by:
  • change the directory, or
  • change the environment variable in settings, or
  • copy logparser.exe to the system32 dir via the command line

Manually change the directory
To use the command line, first open the MS-DOS command prompt (shell) by
start -> run
type cmd
enter
ok
When inside the shell, the format for executing a program command is:
[ program path ]  [ program command ]
Example program command:
Log Parser.exe "SELECT column FROM 'C:\path\to\file.csv' 
WHERE condition ORDER BY column"
Note: A program can be executed when the directory where the program resides is made current. This can be achieved with the command cd (change directory).
Do this via the command line (if using win7, 64bit), with these entries:
  1. cd\    ( you could also type cd C:\  )
  2. cd “Program Files (x86)”
  3. cd “Log Parser 2.2”  Notice the current directory reads:
    C:\Program Files (x86)\Log Parser 2.2 
  4. dir (lists all files in the current directory)
  5. Log Parser.exe “SELECT column FROM ‘C:\path\to\file.csv‘ WHERE condition ORDER BY column” (enter the columns and conditions you want to search for)
Side note: to access drive D, just type D: at the command line.


Add to the PATH environment variable in settings

Setting the path as an environmental variable will allow you to execute #5 above without having to enter the path to the exe. Here is a good video. Each path is separated with a semi-colon.
More advanced users can use the set command with the command prompt like this:
set PATH=C:\path\to\program.exe\;%PATH%
This command will add the specified path to your environment variable while your command prompt is open. When it is closed, the path will return to what it was previously.
These instructions can be used to execute any program on the command line.
Log Parser is a great tool for many things, which include server log analysis, charting, and datagrid output, but this next article will focus on how to use it for searching through semrush CSV files.

Enter Your Email Address