We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

Compare two CSV files and export to a thirdRSS

1 reply

Last post Jun 26, 2014 03:36 AM by Perkinsville

  • Compare two CSV files and export to a third

    Apr 02, 2014 05:33 PM|Mishaua|LINK

    Is there any way to compare two csv files with LogParser and save the results to a new csv?

    I found this code for comparing of data from one CSV exists in another, but how would I check if the data is different?

    SELECT
        SamAccountName,
        LastLogonTimeStamp,
        WhenCreated,
        PasswordNeverExpires,
        AccountExpires,
        Description
    INTO
        finalnew.csv
    FROM
        new.csv
    WHERE
        SamAccountName NOT IN
        (SELECT SamAccountName
         FROM master.csv)

  • Re: Compare two CSV files and export to a third

    Jun 26, 2014 03:36 AM|Perkinsville|LINK

    Hi,

    I can't think of a simple solution for this one, but the idea I do have is that you take both files and store all the content into 2 seperate, but identical tables.  Then you can create a VIEW that contains only the data you want to see.  Then export that data to the location you want.

    HTH, Benjamin