04-03-2009
35,
0
Join Date: Apr 2009
Last Activity: 16 September 2010, 11:43 AM EDT
Posts: 35
Thanks Given: 0
Thanked 0 Times in 0 Posts
Please correct my Script
I am new to awk, can somone please correct the following script
awk -F "," 'BEGIN {
foreach ((getline < "file1.csv") > 0)
{i++
a[i]=1 --> assuming the first column in the row will be stored in a[]
foreach (a[i] in f1) {
if (a[i] == $5) continue
print a[i];
}
}
} file2.csv'
Here is what I want to do
File 1
laeg.com,2/2/23,a,b,ga
aeg.com,2/2/23,a,b,ga
xyz.com,2/2/12,a,b,c
eg.com,2/2/23,a,b,ga
File 2
1,2,ua,xyz.com
1,2,ua,abc.com
1,2,ua,eg.com
1,2,ua,easg.com
1,2,ua,zth.com
File 3
laeg.com,2/2/23,a,b,ga
aeg.com,2/2/23,a,b,ga
while reading in file1 it should compare in each row on file2 if found any where in the file2 it should be ignored while writing into output file.