Comparing 2 pipe-delimited text files

S

sgcanning

Hi,
I am trying to compare two pipe-delimited text files which have been
exported from an Access database.
Thing is that I need to compare each record by the primary key
(CodeNumber) and 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.
Sean
 
H

Harlan Grove

(e-mail address removed) wrote...
I am trying to compare two pipe-delimited text files which have
been exported from an Access database.
Thing is that I need to compare each record by the primary key
(CodeNumber) and 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.
....

Is there any good reason you're not comparing the tables from which
these text files were generated in Access? Generating the records in
one of the other table with no matching key field in the other table
involves only an outer join on the key fields with the criteria for
the key field for the table matched against being NULL.

SELECT tbl1.*
FROM tbl1 LEFT JOIN tbl2 ON tbl1.key = tbl2.key
WHERE (((tbl2.key) Is Null));

produces a table containing records in tbl1 with no matching key field
in tbl2, and

SELECT tbl2.*
FROM tbl1 RIGHT JOIN tbl2 ON tbl1.key = tbl2.key
WHERE (((tbl1.key) Is Null));

produces a table containing records in tbl2 with no matching key field
in tbl 1.

You could do this manually in Excel, importing each file into separate
worksheets, parsing them into fields, then using formulas like

X2: =COUNT(MATCH(A2,INDEX(OtherImportedParsedFile,0,1),0))

filled down for each record in the respective worksheets, then
autofiltering each worksheet on that column of formulas.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top