Jump to content
Macro Express Forums

Comparing Two Text Files ?


Tommyboy

Recommended Posts

Hi everyone,

 

I'm a newbie on this site. I am trying to create a macro at work that compares two separate text files.

 

It counts the occurence of each word that appears in both files more than once.

Then it dispays the occurence of each word in both text files.

 

The text from both files is completely random text.

 

 

If you need any more info please ask,

 

 

Tom :D

Link to comment
Share on other sites

HI CORY,

 

What i would like the macro to do is:

 

1. Open notepad1.txt

2. Locate all occurences of "Feedback" in each line of text in notepad1.txt

3. counter

 

1. Open notepad2.txt

2. Locate all occurences of "Feedback" in each line of text in notepad2.txt

3. counter

4. Then (If variable %T6% contains variable %T2%, display text box)

(It should display in the the text box the lines in notepad1 which also appear in notepad2 )

 

 

The code below is how far i got, but kinda got stuck on it.

 

 

 <BTFBEG:001:000060:000000:\\dub-efs-01\home\tshanahan\Desktop\notepad1.txt><DELAY:.2><TMVAR2:05:01:01:000:000:><NMVAR:05:01:0:0000002:0:0000000><IFVAR2:1:01:7:TFeedback><IVAR2:03:01:0><NMVAR:08:04:0:0000001:0:0000000><TBOX4:T:1:000974000392000278000200:000:notepad1%T1%


Line: %N4%><ENDIF><BTFEND><DELAY:.2><BTFBEG:005:000060:000000:\\dub-efs-01\home\tshanahan\Desktop\notepad2.txt><DELAY:.2><TMVAR2:05:05:05:000:000:><NMVAR:05:05:0:0000006:0:0000000><IFVAR2:1:05:7:TFeedback><IVAR2:07:01:0><NMVAR:08:08:0:0000001:0:0000000><IFVAR2:4:06:7:T2T><TBOX4:T:1:CenterCenter000278000200:000:Similar Feedback Found%T2%

%T6%
><ENDIF><TBOX4:T:1:000986000393000278000200:000:notepad2%T5%


Line: %N8%><ENDIF><BTFEND>

Link to comment
Share on other sites

First off I would not open the files. I would load them into text vars. Then do a repetitive loop to find and replace all occurrences one at a time so that you can count them. We had a recent thread on this if you dig around a bit.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...