Jump to content
Sign in to follow this  
langthang084

how to compare content of 2 txt files.

Recommended Posts

langthang084

I have two text files:

TEXT 1:

" AAAAAA

BBBBB

CCCCC
DDDDD

..........."

TEXT 2:
"BBBBB

EEEEE

DDDD

......."

I want to check all the lines in each files, and export to two new text files: one include the duplicate line, and one include the remainder. 

How could I do this?

Share this post


Link to post
Share on other sites
Jury

read each file into an array and search each element in each array if an element does exist in the other array then pop it out as dublicate - when finised _ArrayConcatenate the two arrays into one and do a _ArrayUnique on that giving you the remainder.  I assume you know how to write your results to two different files.

or didn't I understand you correctly? 

Edited by Jury

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×