Search Results

Search: Posts Made By: Mary James
2,562
Posted By sdf
It depends on what you want to select. If you...
It depends on what you want to select. If you want only those rows of file1 where field 1 is in file2 than use:

awk 'BEGIN{FS="|"}NR==FNR{a[$1]=$1;next}a[$1]' file2 file1 >selected_lines

If...
2,379
Posted By mukeshguliao
awk -F, '!a[$1,$2,$3]++' UnixEg.dat i...
awk -F, '!a[$1,$2,$3]++' UnixEg.dat


i tried above, but got an error
a[$1,$2,$3]++': Event not found






guess could be beacause of ! . escaped by \

awk -F, '\!a[$1,$2,$3]++'...
1,188
Posted By Franklin52
Try this: awk...
Try this:
awk 'NR==FNR{a[$1];next}!(substr($0,1,5) in a)' file2 file1


Use nawk or /usr/xpg4/bin/awk on Solaris.
Showing results 1 to 3 of 3

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