![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| File structure comparison | krishmaths | Shell Programming and Scripting | 3 | 07-07-2008 01:16 PM |
| file comparison...help needed. | er_ashu | UNIX for Dummies Questions & Answers | 4 | 05-15-2008 09:37 PM |
| Output format - comparison with I/p file | velappangs | Shell Programming and Scripting | 1 | 04-03-2008 06:31 AM |
| file comparison script | tiger99 | Shell Programming and Scripting | 1 | 01-30-2008 10:47 AM |
| File Comparison | net_shree | Shell Programming and Scripting | 19 | 01-10-2008 08:00 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
hi
I have 2 files to comapre ,in file a sible column it is numbers,in file b2 numbers and other values with coma separated. i want compare numbers in file a with file b,and the out put put should be in C with numbers in both file a and b along with other columns of file b. i used folowing scripts for line in `cat gprs2.txt` do more gprs_calls2.txt |grep $line >> NEW2.txt done exit but it is not giving correct out put.and also this scrpits is not sppedy plz help.. |
|
||||
|
The files are like this
File1 12345 56789 23456 File2 12345 fsfsdf 76775 23456 ytyy 090890 66444 rytry 878878 The out put should be 12345 fsfsdf 76775 23456 ytyy 090890 The file1 contains arround 1 million lines file2 has 2.5 million lines pls help.. |
|
||||
|
I have Tried .could u plz help..
out 'NR==FNR{_[$1];next}$1 in _' gprs2.txt gprs_calls2.txt scripts by rplacing the respective filenames ,the out put does not have any data the actual file lokks like this Source file 7055000601 7055000633 7055000965 7055001182 7055001352 7055001468 Dest file to be compared(Source file no should be compared with dest file,the out should be the no of desti ,which exists in source,along with othere columns of desti corresponds the number 7055000601,35250401506992,621505200525591 7055000633,35574402566128,621505200525623 7055000965,35966800701265,621505200525952 7055001182,35844301188404,621505200526156 7055001352,35350902954276,621505200526325 7055001468,35195101170824,621505200526441 7055001490,35501600003290,621505200526463 7055003310,35487502010707,621505200528256 7055006309,04857558566586,621505200531213 |
|
||||
|
The field separator is missing from radoulov's script.
Code:
awk -F, 'NR==FNR{_[$1];next}$1 in _' gprs2.txt gprs_calls2.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 |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|