Comparing Two Pipe-Delimited files

Hi All,
I am trying to compare two pipe-delimited text files which have been
exported from an Access database.
The thing is that I need to compare each record by the primary key
(CodeNumber) in these two text files and then if there are differences then I need to put the different record into another text file.
Can anyone help me with this? I keep getting told that this would be
easy, but I have very limited experience with coding.
Thank you in advance for your attention, and any help that you can give
me.
Have a great weekend!
Sean

Comments

  • : Hi All,
    : I am trying to compare two pipe-delimited text files which have been
    : exported from an Access database.
    : The thing is that I need to compare each record by the primary key
    : (CodeNumber) in these two text files and then if there are
    : differences then I need to put the different record into another
    : text file.
    : Can anyone help me with this? I keep getting told that this would be
    : easy, but I have very limited experience with coding.
    : Thank you in advance for your attention, and any help that you can
    : give
    : me.
    : Have a great weekend!
    : Sean
    :

    if the data is in access then its easy with a query. join both tables on the primary key and see if the query returns the same amount of records [only matching records will be returned] as in the tables themselves. you can also join other fields if you need to test them.

    how can you find out which records don't match? again with a query in sql-view-

    unmatched in table1 for field N1-

    SELECT *
    FROM Tbl1
    WHERE (((Tbl1.N1) Not In (SELECT N2 FROM Tbl2)));


    unmatched in table2 for field N2-

    SELECT *
    FROM Tbl2
    WHERE (((Tbl2.N2) Not In (SELECT N1 FROM Tbl1)));


    another way, when you join table1 & table2, dbl-click the join line and change the join properties to a "2" or "3" so that a LEFT/RIGHT join is performed. then look for a null value in one of your query columns

    query sql will be like-
    SELECT T1.N1, T1.Name, T2.N2, T2.Name
    FROM T1 LEFT JOIN T2 ON T1.N1 = T2.N2;

    return example:

    Primary1 Primary2
    A1 A1
    B2 <<empty, so no match in table2
    C3 C3
    D4 <<empty, so no match in table2
    E5 E5
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion