The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: file comparison
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #7 (permalink)  
Old 10-09-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
The field separator is missing from radoulov's script.

Code:
awk -F, 'NR==FNR{_[$1];next}$1 in _' gprs2.txt gprs_calls2.txt
Your description of the output you require is not understandable to me. This will print the lines in gprs_calls2.txt whose first field matches a value in (the first field of) gprs2.txt.

Last edited by era; 10-09-2008 at 06:25 AM.. Reason: I mean the earlier version of radoulov's script -- we posted basically at the same time