GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Shell command output unique IDs... comm command (https://gfy.com/showthread.php?t=1036891)

acctman 09-05-2011 04:14 PM

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 09-05-2011 09:18 PM

-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

CYF 09-07-2011 09:49 PM

did you get this figured out?

thagreek 09-08-2011 03:25 AM

If you want hit me up on icq. I can help you out.

Barry-xlovecam 09-08-2011 07:21 AM

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";

}


fris 09-09-2011 06:15 AM

you could just sort with the -u variable for unique


All times are GMT -7. The time now is 12:45 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123