LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 10-12-2013, 09:25 PM   #1
l_ravi69
LQ Newbie
 
Registered: Sep 2013
Posts: 1

Rep: Reputation: Disabled
to grep 100 letters out of 500 letters on certain criteria


I am having file containing 500 letters sorted on the basis of serial numbers. Now I want to grep 100 letters for which serial numbers are saved in other file. Is it possible to get the letters of these 100 numbers only using any option .
 
Old 10-13-2013, 01:27 AM   #2
Dafydd
Member
 
Registered: Oct 2008
Posts: 290

Rep: Reputation: 22
Write a script that reads the list of numbers to look for one at at time. Feed each one at a time to grep to search in other list.
 
Old 10-13-2013, 04:06 AM   #3
grail
Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 7,179

Rep: Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781
May even help if you provided examples, but grep has the option to read from a file for its patterns
 
Old 10-13-2013, 11:37 AM   #4
danielbmartin
Senior Member
 
Registered: Apr 2010
Location: Apex, NC, USA
Distribution: Ubuntu
Posts: 1,032

Rep: Reputation: 275Reputation: 275Reputation: 275
Quote:
Originally Posted by l_ravi69 View Post
I am having file containing 500 letters sorted on the basis of serial numbers. Now I want to grep 100 letters for which serial numbers are saved in other file. Is it possible to get the letters of these 100 numbers only using any option .
The letters are all in one file. What distinguishes the beginning and end of each letter? Is the relevant serial number prefixed to every line in each letter?

Daniel B. Martin
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't stop fast typing double letters from "skipping" one of the letters. Lola Kews Ubuntu 3 04-20-2013 03:21 PM
firefox without letters eddygrinder Slackware 9 01-05-2010 05:22 PM
How to get accented letters ? PaulFXH Linux - Hardware 1 06-25-2008 11:30 AM
some letters unavailable edgjerp Linux - Software 2 05-15-2008 06:55 AM
grep exact letters packets Linux - Newbie 1 11-30-2007 08:39 PM


All times are GMT -5. The time now is 07:31 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration