![]() |
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 |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how can i add two numbers | kripssmart | UNIX for Dummies Questions & Answers | 4 | 01-06-2009 06:45 PM |
| Numbers of records in SAS dataset | sasaliasim | Shell Programming and Scripting | 2 | 04-21-2008 04:55 PM |
| need top 3 numbers | shary | Shell Programming and Scripting | 4 | 03-25-2008 01:58 AM |
| How to add numbers? | pnxi | Shell Programming and Scripting | 7 | 09-11-2003 06:25 AM |
| Add some numbers! | TalkShowHost | Shell Programming and Scripting | 3 | 05-15-2002 12:28 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
seperating records with numbers from a set of numbers
I have two files one (numbers file)contains the numbers(approximately 30000) and the other file(record file) contains the records(approximately 40000)which may or may not contain the numbers from that file.
I want to seperate the records which has the field 1=(any of the number from numbers file). Can you please suggest how it can be achieved without having performance issues. ![]() Regards Shiv@jad |
|
||||
|
$> cat data.dat
1,3,4, m,h,j 4,5,h h,t,y r,t,b 3,f,r $> cat numbers.dat 1 2 3 4 5 for i in `cat numbers.dat` do cat data.dat|awk -F"," '{if($1==number) print $0}' number="$i" done OUTPUT 1,3,4, 3,f,r 4,5,h |
![]() |
| Bookmarks |
| Tags |
| shell script, shell scripting, unix scripting, unix scripting basics |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|