LogParse, C#, CSV and ValidationRSS

3 replies

Last post Jun 05, 2006 03:53 PM by tomkmvp

  • LogParse, C#, CSV and Validation

    Jun 05, 2006 11:30 AM|Liming|LINK

    Hi all,

    I'm new at creating a C# application that uses LogParser.

    1. How do I import a csv file in my code? I was able to parse IIS log file okay, but my csv file doesn't have any header, so I don't know what columsn to query against? In addition, how do I specify my delimiter? I've searched the command line query goes something like this..

    logparser "SELECT Field1 AS Date, Field2 AS Time, Field7 AS User,
    Field9 AS Description FROM c:\Temp\Securiy.csv WHERE Field6=560" -i:csv -headerRow:Off

    but I haven't found a way to specifiy my own delimiter.

    2. I'm trying to import this cvs file and I need to know if certain columns are in certain types. For example, first column is a date type, second column is an integer type. If they are not, I need to get an error message.

    Can logparser do that?

    Thanks

    Liming

    Liming Xu
    Jumptree ASP.NET 2.0 Project Management, Bug Tracking & Task Management - Encourages collaboration, provides transparency and comes with metrics.

    JQuery Gantt, JQuery Calendar, SiteMinder/AD Authentication, Customizable Languages, Custom Fields, Lucene.Net Search, and more
  • Re: LogParse, C#, CSV and Validation

    Jun 05, 2006 02:33 PM|tomkmvp|LINK

    1. Don't you know the source you're querying against?  If it has no header, you'll need to know what fields there are.  As for a delimeter, isn't it a comma (Comma Seperated Values)?

    2. No.

  • Re: LogParse, C#, CSV and Validation

    Jun 05, 2006 03:20 PM|Liming|LINK

    my bad.

    i should've broken up #1 into another question. In addition to import csv file, if I have a text file much like a csv file but with custom delimiter,how do I specify a custom delimiter?

    Thanks.

     

    Liming Xu
    Jumptree ASP.NET 2.0 Project Management, Bug Tracking & Task Management - Encourages collaboration, provides transparency and comes with metrics.

    JQuery Gantt, JQuery Calendar, SiteMinder/AD Authentication, Customizable Languages, Custom Fields, Lucene.Net Search, and more
  • Re: LogParse, C#, CSV and Validation

    Jun 05, 2006 03:53 PM|tomkmvp|LINK

    Check out COM Input Format Plugins in the documentation.