Shell command output unique IDs... comm command

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • acctman
    Confirmed User
    • Oct 2003
    • 2840

    #1

    Shell command output unique IDs... comm command

    i'm using the line command comm but i'm getting zero results.
    comm -23 newid.txt master.txt > new.txt

    I'm trying to pull all the unique id's from newid.txt is there another method I can use? both files have been sorted already.
  • CYF
    Coupon Guru
    • Mar 2009
    • 10973

    #2
    -23 disregards columns 2 and 3, is that what you're looking for? without seeing a sample of each file it's hard to guess.

    Have you tried something like this:

    diff newid.txt master.txt > new.txt
    Webmaster Coupons Coupons and discounts for hosting, domains, SSL Certs, and more!
    AmeriNOC Coupons | Certified Hosting Coupons | Hosting Coupons | Domain Name Coupons

    Comment

    • CYF
      Coupon Guru
      • Mar 2009
      • 10973

      #3
      did you get this figured out?
      Webmaster Coupons Coupons and discounts for hosting, domains, SSL Certs, and more!
      AmeriNOC Coupons | Certified Hosting Coupons | Hosting Coupons | Domain Name Coupons

      Comment

      • thagreek
        Confirmed User
        • Dec 2006
        • 463

        #4
        If you want hit me up on icq. I can help you out.
        ICQ: 335034

        For sale: oojz.com / upbot.com / iMarijuana.com / toughmarketing.com / playfulencounter.com (website included)

        Misc.: 2x ATX2 licenses ($50 each)

        Comment

        • Barry-xlovecam
          It's 42
          • Jun 2010
          • 18083

          #5
          If you just want unique names ...

          Here is a Perlish way to do it ...

          Code:
          #!/usr/bin/perl
          
          use CGI::Carp qw/fatalsToBrowser/;
          use CGI qw/:standard/;
          use strict;
          use warnings;
          
          print "Content-type: text/html\n\n";
          
          
          
          my $raw="file1";
          #my $sorted="file2";#open and print file
          open RAW,"<", $raw or die "<raw";
          my @array=(<RAW>);
          
          
                         my %seen = ();
                         my @unique = grep { ! $seen{ $_ }++ } @array;
          
          foreach my  $unique( @unique ){
          chomp;
          print "$unique<BR>\n";
          
          }

          Comment

          • fris
            Too lazy to set a custom title
            • Aug 2002
            • 55679

            #6
            you could just sort with the -u variable for unique
            Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

            Comment

            Working...