Compare two collection in sharepoint

Hii
I want to Compare to collection in sharepoint
example:
Collection 1: "A","B","C"
Collection 2:"A","B","D","E"
Result should be: "C"
Like in C#  List<string> result = list1.Except(list2).ToList();
I am new to programming Please help me..
regards 
sudeep

http://stackoverflow.com/questions/3407356/comparing-two-collections
check this example code below
class CompareLists
static void Main()
// Create the IEnumerable data sources.
string[] names1 = System.IO.File.ReadAllLines(@"../../../names1.txt");
string[] names2 = System.IO.File.ReadAllLines(@"../../../names2.txt");
// Create the query. Note that method syntax must be used here.
IEnumerable<string> differenceQuery =
names1.Except(names2);
// Execute the query.
Console.WriteLine("The following lines are in names1.txt but not names2.txt");
foreach (string s in differenceQuery)
Console.WriteLine(s);
// Keep the console window open in debug mode.
Console.WriteLine("Press any key to exit");
Console.ReadKey();
/* Output:
The following lines are in names1.txt but not names2.txt
Potra, Cristina
Noriega, Fabricio
Aw, Kam Foo
Toyoshima, Tim
Guy, Wey Yuan
Garcia, Debra
http://msdn.microsoft.com/en-us/library/bb397894.aspx
Mark ANSWER if this reply resolves your query, If helpful then VOTE HELPFUL
INSQLSERVER.COM
Mohammad Nizamuddin

Similar Messages

  • How can I compare two collections at the same time? (View two grid views)

    I have two collections containing some of the same images. (My Nikon D70 did not put an end-of-file on some images. I recovered them into a different collection.) Now I want to display both collections side-by-side in grid view. I will select those images in the "recovered" collection that correspond to the bad images in the "main" collection, add the ratings etc, and move just these to another collection.
    It is extremely frustrating to have to bounce back and forth between collections, remembering each image one by one and selecting it in the "recovered" collection. (The image names are not preserved in the "recovered" collection -- I have to go by what the image looks like.)
    LightRoom allows me to compare photos in the compare view. I want to compare collections in two grid views.

    CaptureTheLight,
    you have ran into a situation when you have to compare two sets of images and now you're wondering how come Lightroom doesn't have such "obviously necessary" functionality? But you have to admit it, this is not such a common situation in a photographer's workflow recovers broken files and tries to compare them against themselves. I think it's a pretty specific feature you need. Still, Lightroom has enough powerful tools for editing and sorting images.
    For example...
    You could just put them all - "main" and "recovered" - into a single collection or into the Quick Collection. Label the entire "recovered" collection with, say, red and sort by capture time. Now you'll have everything side by side, ordered chronologically. The "recovered" images will stay next to the "main" images since their capture time will be the same, and they will also stand out since they have the red label.
    Make the thumbnails bigger and set up the grid view so it tints the thumbnail cell are tinted with the label color. Now, you can go quickly through them visually checking labeled vs unlabeled.

  • Shall we compare two elements in a collection

    Dear all,
    shall we compare two scuccessive elements in a collection
    i am creating a type.and i am dumping the data into that type using bulk collect.now i need to compare the data in type (previous value and current value).
    please suggest
    Thank you.
    Suresh

    899511 wrote:
    Dear all,
    shall we compare two scuccessive elements in a collection
    i am creating a type.and i am dumping the data into that type using bulk collect.now i need to compare the data in type (previous value and current value).
    please suggest
    Thank you.
    SureshDon't do it in a collection. Use SQL.
    SQL provides Lead and Lag analytical function that allow you to compare next/previous values.
    e.g.
    http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions070.htm
    Loading the data into a collection in memory to do something that can be easily achieved in SQL is just wrong and uses expensive PGA memory unnecessarily.

  • Performance issues comparing two vectors

    I need some advice on what is the fastest way to compare two vectors. My question is all about performance;
    I have two vectors one(Vect A) of which has more than 20000 string values and the other Vector B would hold typically around 200 strings.I compare them both to find out if Vector B has values in Vector A and remove those.
    I iterate thro each element in a loop from the smaller to the bigger vector comparing element by element.But it takes a long time.
    Is there any quick way to do this comparison and can I use contains/compare methods instead of iterating thro the vectors.will it speeden up things
    Arn

    first of all, you should probably examine your collection choice and make sure that java.util.Vector is your best option (assumming you can change the class). Do not use a Hashtable as the previous poster suggested- it doesn't sound like you have a key/value type relationship in your elements, making a Map implementation superflous. Will there be duplicate elements in either Collection? If you will not have duplicate elements, you should probably use a Set collection instead of a List. Does your collection have to be thread-safe? If not, one of the unsynchronized collections should give you better performance (e.g. ArrayList should be quicker then Vector). For the best possible performance, you could use an ordered collection and write your own comparator, so that it does not iterate beyond what ever element assurres that there is no match (i.e. if the first element is "fred" in an ordered collection, you know there will be no match for "adam"). Sun has some good tutorials on the java.util.Collection package that will help you understand the benefit of each implemenation...
    although, and I suppose this is neither here nor there, I wouldn't use java objects to sort through 20K string items- sounds like storing them in a database might be superior. Take care.

  • How to compare two database objects?

    Hi,
    I need to compare two objects with embedded objects/collections in it to tell exact difference between the two.
    e.g.,
    create type t1 as object (name varchar2(10), age number);
    create type t2 as table of t1;
    create type t3 as object (user t1, family t2);
    ... and so on.. this type hirarechy is big in my case..
    I want a procedure/function which can tell me what and where is the difference.
    PROCEDURE (obj1 T1 , obj2 T1) IS
    BEGIN
    END;
    e.g., t1.name = 'John' and t2.name = 'Mich' then it should return t1.name etc..
    Is it possible?
    Thanks

    Why a new thread?
    how to read objects/collections dynamically?

  • I am comparing two documents. The "Not Responding" event happens for over 30 minutes.

    I am comparing two documents using FM 11 on Windows 7. The "Not Responding" event happens for over 30 minutes. When should I force the application to quit?

    It sounds like your installation is corrupted. I don't know what two checkmarks you mean, but when the Setup Assistant starts it collects some personal information after which it will return you to your normal Desktop. If it isn't doing that, then something is not right.
    I think you will need to shut down the computer, then reboot. If you are able to reboot, then check About This Mac under the pple menu to see what version of OS X it shows is installed. If it shows 10.9.x then do the following:
    Repair the Hard Drive and Permissions - Mavericks, Lion/Mountain Lion
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Repair
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported then click on the Repair Permissions button. When the process is completed, then quit DU and return to the main menu. Select Restart from the Apple menu.

  • Compare two similar objects

    Do you know about any possible Java bugs with JDK update?
    In my case, my code stopped working.
    Here is what I have. There are two similar objects, but Object 1 has key, and Object 2 (same as Object 1) has no key. I need to compare both, and if they are equal, I need Object 1 to assign key to Object 2.
    It worked before. How I can get around.
    Please help me if you can.
    Respectfully,
    Alex

    Let me change the question:
    "Can we compare two objects one with key and another one without key? How?

  • Compare two Java Objects without Comparable / Comparator

    Hi Friends,
    I would like to compare two java objects (lots o attributes) without using Comparable / Comparator.
    Any suggestion/sample code would be helpful.
    Thanks,
    Sachin

    I suppose you could design another feature to compare Objects... but that would involve a design process, so asking for sample code is definitely premature. And as EJP says, what would be the point?
    At least that's what I would answer if this was one of those stupid interview questions.

  • How can i compare two excel files with different no. of records.

    Hi
    I am on to a small project that involves us to compare two excel files. i am able to do it but am struck up at a point. When i compare 2 different .csv files with different no. of lines i am only able to compare upto a point till when the number of lines is same in both the files.
    Eg. if source file has 8 lines and target file has 12 lines. The difference is displayed only till 8 lines and the remaining 4 lines in source lines are not shown.
    Can you help me in displaying those extra 4 lines in source file. I am attaching my code snippet below..
    while (((strLine = br.readLine()) != null) && ((strLine1 = br1.readLine())) != null)
                     String delims = "[;,\t,,,|]";
                    String[] tokens = strLine.split(delims);
                    String[] tokens1 = strLine1.split(delims);
                   if (tokens.length > tokens1.length)
                    for (int i = 0; i < tokens.length; i++) {
                        try {
                            if (!tokens.equals(tokens1[i])) {
    System.out.println(tokens[i] + "<----->" + tokens1[i]);
    out.write(sno + " \t" + lineNo1 + " \t\t" + tokens[i] + "\t\t\t\t" + tokens1[i]);
    out.println();
    sno++;
    } catch (Exception exception)
    out.write(sno + " \t" + lineNo1 + " \t\t" + tokens[i] + "\t\t\t\t" + "");
    out.println();
    Thanks & Regards                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    A CSV file is not an Excel file.
    But apart from that your logic makes no sense.
    If the 2 files are of different sizes the files are different by definition, so further comparison isn't needed, you're done.
    If you want to compare individual records, you need to compare all records from one file with all records from the other, unless the order of records is important in which case your current system might work.
    That system however is overly complicated for comparing CSV files.
    As you assume a single record per line, and if one can assume those records to have identical layout (so no leading or trailing whitespace in or between columns in one file that's not in the other) comparing records is simply a matter of comparing the entire lines.

  • Functinality to compare two material price with reference to BOM in CO

    Hi All,
    Is there is any functionality in Controlling which can compare the costing for two FERT materials.
    or
    is there is  any functionality where we can compare two material price with reference to BOM in controlling
    Please help me to compare the material price with reference to BOM
    Regards
    nandu

    Hi,
    You can use this report to compare two itemizations. The report compares the characteristics item number, item category, cost element, resource, material, cost center, plant/work center, cost center/activity type, operation number, BOM item, assembly indicator, and cost component.
    You can access this report as follows:
    Accounting ® Controlling ® Product Cost Controlling ® Product Cost Planning ® Material Costing ® Cost Estimate with Quantity Structure or Cost Estimate Without Quantity Structure ® Compare
    or
    Accounting ® Controlling ® Product Cost Controlling ® Product Cost Planning ® Information System ® Object Comparisons ® For Material ® Itemization Comparison.
    For Detail Please reffer following link:
    http://help.sap.com/saphelp_46c/helpdata/en/56/abd108f1a611d28a950000e8214595/content.htm
    Thanks and Regards
    Binoj M D

  • Compare two input text in adf

    Hi
    i used the Build JDEVADF_11.1.1.4.0
    I want to make compare  validation between two  input text  Are equal or not . same Thing when i create new email i must enter the password and re enter password if not   equal  he give me message

    Hi,
    for a validation String, you can put autosubmit=true and in the valuechangeListener make the comparation.
    How to compare two Strings in java? http://stackoverflow.com/questions/513832/how-do-i-compare-strings-in-java

  • Two collect statement from internal table

    Dear Experts,
    I want populate values to two internal tables from a internal table.
    can i use two collect statement for different internal table from a single internal table.
    advise please.
    Thanks in advance.
    R.Rajendran

    hi there....
    well u can very well use this thing.....
    use the two colect statements inside the loop which u will use  to read the records of the input table.
    hope it helps.
    do reward if it does.

  • Building Site Collections in SharePoint Online

    Hello all,
    Please forgive me for this very basic question, but I was not able to find the info online. 
    Background info: I have a great deal of experience with SharePoint administration on-prem but not much experience with SharePoint Online. My current organization has O365 and wants to build a collaboration environment and an Intranet. I understand the information
    architecture practices that would have been common for this for an on-prem environment, and I understand that those have changed with 2013 and SharePoint Online due to the new practice of organizing everything under one web app. 
    Between reading some articles and using my experience with on-prem, I am trying to design an organized information architecture that will facilitate both environments and the permissions structures they require. My tentative plan was to build one site collection
    for the Intranet under https://mycompany.sharepoint.com/sites (under which subsites would be built for various Intranet divisions), and then a number of individual site collections for the collaboration environment under https://mycompany.sharepoint.com/teams
    (/hr, /finance, etc., so that content owners and users could work in their own site collection without affecting a site collection belonging to someone else). 
    This is the article that initially caused me to believe that this is possible/a good idea: http://blogs.msdn.com/b/richard_dizeregas_blog/archive/2014/09/01/sharepoint-online-information-architecture-considerations.aspx. 
    "For [managed paths] you get the root, /search (explicit managed path), /sites (wildcard managed path), and /teams (wildcard managed path)."
    However this article leads me to believe that I will not be allowed to create any site collections at all, only subsites: https://support.office.com/en-us/article/Plan-sites-and-manage-users-8e568d8d-3d65-42c4-99fa-f7285c9db842. 
    "You cannot create additional site collections in SharePoint Online for Office 365 for Small Business."
    I understand the answer to this may depend on what version of O365 we have, and I am working to find that out. 
    My understanding is that I cannot be made a SharePoint Online administrator without being a global O365 administrator: http://blogs.technet.com/b/lystavlen/archive/2012/06/14/understanding-the-administrator-role-in-sharepoint-online.aspx.
    "You cannot separate the roles of Office 365 global administrator and SharePoint Online Administrator." 
    Thus, I don't currently have the level of access I need to browse around the administration area and find the answers to my questions that way. When the time comes, I will likely be given temporary access or will be working with an O365 global administrator
    to build.
    Main question: Will I be allowed to build site collections under managed paths?
    Larger question: How are others managing the information architecture for an Intranet and a Collaboration environment in SharePoint Online, especially if the answer to the prior question is no?
    Thanks in advance for any insight you can offer. 
    Shae

    Hi,
    According to the error message, the Microsoft.Online.SharePoint.Client.Tenant.dll seems not been loaded.
    You can find it in the path below:
    C:\Program Files\SharePoint Client Components\Assemblies
    A code snippet about how to retrieve a list of site collections in a tenant for your reference:
    const string username = "[email protected]";
    const string password = "password";
    const string tenantAdminUrl = "https://yourdomain-admin.sharepoint.com/";
    var securedPassword = new SecureString();
    foreach (var c in password.ToCharArray()) securedPassword.AppendChar(c);
    var credentials = new SharePointOnlineCredentials(username, securedPassword);
    using (var context = new ClientContext(tenantAdminUrl))
    context.Credentials = credentials;
    var tenant = new Tenant(context);
    SPOSitePropertiesEnumerable spp = tenant.GetSiteProperties(0, true);
    context.Load(spp);
    context.ExecuteQuery();
    foreach (SiteProperties sp in spp)
    Console.WriteLine(sp.Title);
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • How to compare two excel reports and find the difference in BI Publisher

    Hi All,
    I have a requirement that needs to compare two excel reports in XML Publisher 5.6.2. or BI publisher 10.1.3.4
    If anybody has an idea about this pls help us.
    Thanks,

    Since our customer wants to have this comparison only with BI reports....here is the scenario how the comparison should be..
    Now,we have a parameters called Customer name and version id. Version id list will be refreshed based on the customer selection.
    User can generate the report based on the selected customer name and version id. These data are fetch from the oracle database and we are using Data Template in the BI Publisher.
    Now the requirement is customer wants to compare two version id data. for example, v1.2 and v1.3
    Now they wanna to see both the reports while generating in the same work sheet, like, v1.2report should display in the left side and the v1.3report has to display in the right hand side of the same work sheet.
    Now...If there is any addition happened in v1.3 report,then that cell/data should display as a green color in that report.
    If any deletion happened in v1.3report then that should be in the red color.
    If any modification happened in v1.3 then that should be in the yellow color.
    If there is no difference then that should display as it is.
    the thing is that, the both the reports (v1.2 and v1.3)should display side by side in the same worksheet with the format and everything........only the difference should be highlighted.
    Template is same for both the reports..
    To display the data for both versions i think i can generate the template side by side of both in the same worksheet.
    Now, My question is how to find the difference of data in the RTF Template for both the versions
    Can anybody assist me?
    Thanks,
    Edited by: user753355 on Jun 9, 2009 12:03 AM
    Edited by: user753355 on Jun 9, 2009 12:06 AM
    Edited by: user753355 on Jun 9, 2009 12:16 AM
    Edited by: user753355 on Jun 10, 2009 3:59 AM

  • Compare two pdf files using adobe acrobat through command line

    Does anyone know how to compare two pdf files using adobe acrobat through command line. I want to do this via command line because we want to compare hundreds of file every day through some automated windows tasks.
    If command line option is not available in acrobat, then is it feasible to make use of acrobat javascript API to do this task?
    Any kind of help will be greatly.

    Command-line: Not possible.
    JavaScript: Possible, but very limited. Basically the only thing you can do is simulate clicking the Compare Documents button. The rest has to be done manually.
    However, it *might* be possible to automate this process a bit more using a plugin. Ask over at the Acrobat SDK forum for more information...

Maybe you are looking for