Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Pulling out data from one file thats not in another

by rubasov (Friar)
on Apr 27, 2010 at 15:32 UTC ( #837132=note: print w/replies, xml ) Need Help??


in reply to Re^2: Pulling out data from one file thats not in another
in thread Pulling out data from one file thats not in another

There are already several tools to achieve what you want, writing your own is probably needless.

A standard Unix-like solution (works under bash):
$ diff <( sort master ) <( sort completed ) | grep '^<' | cut -d ' ' - +f2-

Depending on your needs you may want to use sort -u instead of a simple sort.

Or if you're under some Debian-derivative distro just install the moreutils package and use combine:

$ combine master not completed 1ao8A 1jkxA 1juvA 1mejA 1meoA 1n0uA 1pjqA

Hope that helps.

Replies are listed 'Best First'.
Re^4: Pulling out data from one file thats not in another
by choroba (Chancellor) on Apr 27, 2010 at 15:53 UTC
    I often use comm instead of diff, too.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://837132]
help
Chatterbox?
[Lady_Aleena]: Hello everyone. I'm having a blonde moment. I can push an array to an array, right? push @to_array, @another_array;
[shmem]: of course
[shmem]: the members of @another_array are conflated to @array
[shmem]: try it out:
[Lady_Aleena]: shmem, thanks. I'm am way out of practice.
[shmem]: perl -lE '@foo = (0..3);@bar = (4..7); push @foo,@bar; say for @foo'
[Lady_Aleena]: shmem, I feel like an idiot for forgetting something so basic.
shmem puts a big cauldron of "silly con charme" on the table in the refectorium

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2017-04-27 11:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (503 votes). Check out past polls.