LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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
  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: 344

Rep: Reputation: 29
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
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192
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: Mint 17.3
Posts: 1,881

Rep: Reputation: 660Reputation: 660Reputation: 660Reputation: 660Reputation: 660Reputation: 660
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



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



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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:58 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration