View Full Version : Comparing 2 colums of numbers question
Hi,
Is it possible for Beyond Compare to compare two colums of tab delimited numbers, one number per each line - only one column contained in each file - and show what numbers in file A are not in file B and vice versa?
The number - letter combinations in each column are completely out of sequence - there is not a one to one correspondence of line numbers as to where any particular code number may be in either column. I just want numbers that do not exist in both colums to be red flagged - in both colums.
If it's possible to do this how would I run a compare?
Thanks anyone.
rodolfog
26-Mar-2006, 03:49 AM
I am not sure to understand what You mean when You say "tab delimited numbers", if there is only one number for each line. I believe that You might try the sort rule. You can find it at
http://www.scootersoftware.com/download.php?c=kb_morerules
Rodolfo Giovanninetti
Yes you are correct RodolfoGiovanninetti the numbers are on separate lines. What I meant was that the two files were saved as tab delimited text files in Microsoft Excel.
I tried the sort tool that you recommended and it worked – it sorted the columns in both files. The problem I have now that I described in my other post -
http://www.scootersoftware.com/ubbthread...page=0#Post5697 (http://www.scootersoftware.com/ubbthreads/showflat.php?Cat=0&Number=5697&an=0&page=0#Post5697) is that I am trying to figure out how to delete the duplicate entries of code numbers contained in each file before I run a compare so that I can red flag and find all code numbers that do not exist in both files and delete them. Would you or anyone have any suggestion how to do this?
Thank you for the earlier assistance!
nadsab
26-Mar-2006, 06:05 PM
This is what I am trying to do. I have two spreadsheet files created in Microsoft Excel, (file A and file B) both of which are about 3000 lines long, and contain a first column of code numbers, and the other columns contain associated data related to the code numbers on the same line. In both files the code numbers may or may not be in numerical or alpha sequence. The spreadsheet was saved as a simple tab delimited table in excel, strictly text based. I want to do the following:
1.) Remove duplicate entries contained in both the files. In other words for file A and file B, I want to automatically delete the lines in which duplicate code numbers appear in column 1, so that only one instance of each code number (and that code number’s associated data) appears in each file.
2.) Once duplicates are deleted from both file A and file B, I want to then run a compare between the two files to see how many code numbers in file A do not exist in file B.
3.) Once I run the compare, I then want to automatically delete all the lines in which any code numbers appear in file A and which do exist in file B.
Can anyone give me advice on how to do this – is this possible to do automatically or would I have to delete all code numbers manually, one by one, after they are red flagged?
nadsab
27-Mar-2006, 10:44 AM
Correction - please change this:
3.) Once I run the compare, I then want to automatically delete all the lines in which any code numbers appear in file A and WHICH DO exist in file B.
To This:
3.) Once I run the compare, I then want to automatically delete all the lines in which any code numbers appear in file A and WHICH DO NOT exist in file B.
Sorry about that.
Chris
27-Mar-2006, 01:12 PM
1) BC doesn't have a method to delete duplicate lines of text within a single file.
If you find a tool to get rid of the duplicates, BC's sort rule is the next thing to use. It might also help to check "Never Align Mismatches" in the Alignment tab of Tools|Edit Current Rules.
Once you have that set, select View|Toolbars|Component. This way you can select a display filter in the toolbar to show only lines that exist on the A side.
nadsab
27-Mar-2006, 01:33 PM
Thanks Chris!
I think I found a way to delete the duplicates in another application.
On your other suggestion, do you mean the "Tools>Pick Rules>Sorted" command? I tried that and am getting the error: "System Error Code 5 Access is denied", both by trying it with and without the "Never Align Mismatches" box checked.
Chris
27-Mar-2006, 02:33 PM
Yes, I meant Tools|Pick Rules|Sorted.
This usually means you don't have permission to read or write a file. The sorted rule runs the DOS Sort command, so try calling Sort from a command line to make sure the command is available on your system.
It might also be an issue writing/reading temp files. The sort rule is an external conversion rule, so BC uses it to create a temp file as output and displays the temp file in the File Viewer.
nadsab
27-Mar-2006, 02:56 PM
Thanks Chris,
That was the problem - I had the same file opened up in MS excel too I think that's what caused it, maybe a sharing violation. I think it's working now.
Just a quick question - if there are duplicates in a file, will one file show any duplicate code numbers as orphans? For example if code number 1234 appears twice in file A and code number 1234 appears only once in file b, will the second code number 1234 in file A appear as an orphan if viewing file A in orphan view? If it does appear as an orphan is there a way I can prevent this from happening using beyond compare other than by deleting duplicates before comparing them?
BTW U have a great product I intend to buy it this week.
vBulletin® v3.7.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.