Solved: Re: Diff two address lists?
- From: Patton <p.echols@xxxxxxxxxxx>
- Date: Mon, 30 Jul 2012 07:49:27 -0700
On 07/28/2012 10:11 AM, Jonesy wrote:
On Fri, 27 Jul 2012 20:08:22 -0700, Patton wrote:I have a need to compare two lists of email addresses. Each one is a_IF_ (big "if") the two lists are pure email addys with no further
text file with address per line. What I need to output is a list of
email addresses that are only in list B, I do not want the addresses
that are in both or are only in A.
embellishments/contents, something viz:
grep -v -f "B"_file "A"_file
Or, maybe I'm rong. Haven't had my coffee yet....
Jonesy
Thanks, but since the lists had columns for "first name" "Last name" and "Full Name", I think that would not work. I ended up doing a script that did something similar
For those searching the archives with the same problem,
#! /bin/bash
# Crosswalk file1 against file2
# output lines of file2 not in file1 to file3
# Use Syntax parse-csv.sh file1 file2 file3
FILE_1="$1"
FILE_2="$2"
FILE_3="$3"
cp $FILE_2 TX_FILE_1.csv
# for each line, parse the fields into script variables
while IFS='\",\"' read a b c d
do
# Now grep the TX file and print everything but the line with the email in the line of the first input file ($d )
grep -v $d TX_FILE_1.csv > TX_FILE_2.csv
mv TX_FILE_2.csv TX_FILE_1.csv
# Next for debugging, to see what the script thinks the variable is
echo "Dee is equal $d"
done < $FILE_1 #end the loop
cp TX_FILE_1.csv $FILE_3
=====================
There might have been a more elegant way, but this worked. Anyone wants to comment, I appreciate learning new stuff.
--
Patton
--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
- Follow-Ups:
- Re: Solved: Re: Diff two address lists?
- From: Kevin O'Gorman
- Re: Solved: Re: Diff two address lists?
- References:
- Diff two address lists?
- From: Patton
- Re: Diff two address lists?
- From: Jonesy
- Diff two address lists?
- Prev by Date: Re: Moving My System to a New Disk After a Crash
- Next by Date: Re: I reboot Ubuntu 5x a week
- Previous by thread: Re: Diff two address lists?
- Next by thread: Re: Solved: Re: Diff two address lists?
- Index(es):
Relevant Pages
|