Search Results

Search: Posts Made By: jyu3
3,567
Posted By Jotne
awk Tutorial PS I have changed !A[$1]++ to...
awk Tutorial

PS I have changed !A[$1]++ to !A[$1], there are no need to imcrement value for the second part

awk -F, 'NR==FNR{A[$1]++;print;next} !A[$1]' f2 f1 | sort

Some more easy to read...
3,567
Posted By pamu
Messed up with requirement :oawk -F,...
Messed up with requirement :oawk -F, 'NR==FNR{A[$1]=$0;next}{if(A[$1]){print A[$1];delete A[$1]}else{print}}
END{for(i in A){if(A[i]){print A[i]}}}' file2 file1
Thanks for changing the code...
3,567
Posted By pravin27
awk -F"," 'NR==FNR{a[$1]=$0;next} {print...
awk -F"," 'NR==FNR{a[$1]=$0;next}
{print $0;delete a[$1]}
END {for (i in a){print a[i]}}' File1 file2 | sort
3,567
Posted By Yoda
Try this: awk -F, ' NR == FNR { ...
Try this:
awk -F, '
NR == FNR {
A[$1] = $0
next
}
{
B[$1] = $0
}
A[$1] {
$0 = A[$1]
...
1,774
Posted By alister
No, that's not what I meant. What I described in...
No, that's not what I meant. What I described in my first post is all you need to do. There is no need to store the file in an array.

Throw away what you've got. Then, simply set the separator,...
Showing results 1 to 5 of 5

 
All times are GMT -4. The time now is 03:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy