Sponsored Content
Top Forums Shell Programming and Scripting Selecting records from file on criteria. Post 59337 by videsh77 on Thursday 16th of December 2004 12:47:08 PM
Old 12-16-2004
Question Selecting records from file on criteria.

Can I have 2 files as in input to the awk command?

Situation is somewhat below,

File A contains number & value delimited by a space.
File B contains number as a part of a line. I am not supposed
to retrieve more than 1 number from a line.

If number from file B matches with number from file A, then I will
retrieve value part from file A. I will store this found,
number - value pair in file C.

Would it be possible with single awk command? Or is there any suggestions to implement this?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Select records based on search criteria on first column

Hi All, I need to select only those records having a non zero record in the first column of a comma delimited file. Suppose my input file is having data like: "0","01/08/2005 07:11:15",1,1,"Created",,"01/08/2005" "0","01/08/2005 07:12:40",1,1,"Created",,"01/08/2005"... (2 Replies)
Discussion started by: shashi_kiran_v
2 Replies

2. Shell Programming and Scripting

Count No of Records in File without counting Header and Trailer Records

I have a flat file and need to count no of records in the file less the header and the trailer record. I would appreciate any and all asistance Thanks Hadi Lalani (2 Replies)
Discussion started by: guiguy
2 Replies

3. Shell Programming and Scripting

Selecting rows with a specific criteria

Hi, I want a UNIX command that can filter out rows with certain criteria. The file is tab deliminated. Row one is just a value. Basically what I want to do is select based on the name and character at the end (o). So lets lets say i want a row that has WashU and (o) then it would print... (2 Replies)
Discussion started by: phil_heath
2 Replies

4. UNIX for Dummies Questions & Answers

Grep specific records from a file of records that are separated by an empty line

Hi everyone. I am a newbie to Linux stuff. I have this kind of problem which couldn't solve alone. I have a text file with records separated by empty lines like this: ID: 20 Name: X Age: 19 ID: 21 Name: Z ID: 22 Email: xxx@yahoo.com Name: Y Age: 19 I want to grep records that... (4 Replies)
Discussion started by: Atrisa
4 Replies

5. Shell Programming and Scripting

Deleting duplicate records from file 1 if records from file 2 match

I have 2 files "File 1" is delimited by ";" and "File 2" is delimited by "|". File 1 below (3 record shown): Doc1;03/01/2012;New York;6 Main Street;Mr. Smith 1;Mr. Jones Doc2;03/01/2012;Syracuse;876 Broadway;John Davis;Barbara Lull Doc3;03/01/2012;Buffalo;779 Old Windy Road;Charles... (2 Replies)
Discussion started by: vestport
2 Replies

6. Shell Programming and Scripting

Extract error records based on specific criteria from Unix file

Hi, I look for a awk one liner for below issue. input file ABC 1234 abc 12345 ABC 4567 678 XYZ xyz ght 678 ABC 787 yyuu ABC 789 7890 777 zxr hyip hyu mno uii 678 776 ABC ty7 888 All lines should be started with ABC as first field. If a record has another value for 1st... (7 Replies)
Discussion started by: ratheesh2011
7 Replies

7. Shell Programming and Scripting

Input file is uncolored; I want the output file to be colored on criteria

Hello, I have the following input file: auditing account: 3DTP (3dtp) ERROR: S3 bucket "aws-origin-test1.3dstage.com" has policy statement with public grant: {"Sid":"PublicReadGetObject","Effect":"Allow","Principal":{"AWS":"*"},"Action":,"Resource":} auditing region: eu-west-1 auditing... (5 Replies)
Discussion started by: ramky79
5 Replies

8. Shell Programming and Scripting

Separate records of a file on 2 types of records

Hi I am new to shell programming in unix Please if I can provide help. I have a file structure of a header record and "N" detail records. The header record will be the total number of detail records I need to split the file in 2: One for the header Another for all detail records Could... (1 Reply)
Discussion started by: jamcogar
1 Replies

9. Shell Programming and Scripting

Awk/sed/cut to filter out records from a file based on criteria

I have two files and would need to filter out records based on certain criteria, these column are of variable lengths, but the lengths are uniform throughout all the records of the file. I have shown a sample of three records below. Line 1-9 is the item number "0227546_1" in the case of the first... (15 Replies)
Discussion started by: MIA651
15 Replies

10. UNIX for Beginners Questions & Answers

Insert content from file 1 to file 2 in specific criteria meet

Hi , I'm looking for some code that can copy and paste form file1 to file2 with 2 criterial meet. file1: test "sp-j1" test "sp-j2" test "sp-j3" test "sp-j4" file2: sub Pre_Shorts1 (Status_Code, Message$) global Status !if Message$ <> "" then print... (3 Replies)
Discussion started by: kttan
3 Replies
PERLBOOK(1)						 Perl Programmers Reference Guide					       PERLBOOK(1)

NAME
perlbook - Books about and related to Perl DESCRIPTION
There are many books on Perl and Perl-related. A few of these are good, some are OK, but many aren't worth your money. There is a list of these books, some with extensive reviews, at http://books.perl.org/ . We list some of the books here, and while listing a book implies our endorsement, don't think that not including a book means anything. Most of these books are available online through Safari Books Online ( http://safaribooksonline.com/ ). The most popular books The major reference book on Perl, written by the creator of Perl, is Programming Perl: Programming Perl (the "Camel Book"): by Larry Wall, Tom Christiansen, and Jon Orwant ISBN 978-0-596-00027-1 [3rd edition July 2000] http://oreilly.com/catalog/9780596000271/ The Ram is a cookbook with hundreds of examples of using Perl to accomplish specific tasks: The Perl Cookbook (the "Ram Book"): by Tom Christiansen and Nathan Torkington, with Foreword by Larry Wall ISBN 978-0-596-00313-5 [2nd Edition August 2003] http://oreilly.com/catalog/9780596003135/ If you want to learn the basics of Perl, you might start with the Llama book, which assumes that you already know a little about programming: Learning Perl (the "Llama Book") by Randal L. Schwartz, Tom Phoenix, and brian d foy ISBN 978-0-596-52011-3 [5th edition June 2008] http://oreilly.com/catalog/9780596520113 The tutorial started in the Llama continues in the Alpaca, which introduces the intermediate features of references, data structures, object-oriented programming, and modules: Intermediate Perl (the "Alpaca Book") by Randal L. Schwartz and brian d foy, with Tom Phoenix foreword by Damian Conway ISBN 978-0-596-00478-1 [1st edition March 2006] http://oreilly.com/catalog/9780596004781/ References You might want to keep these desktop references close by your keyboard: Perl 5 Pocket Reference by Johan Vromans ISBN 978-0-596-00374-6 [4th edition July 2002] http://oreilly.com/catalog/9780596003746/ Perl Debugger Pocket Reference by Richard Foley ISBN 978-0-596-00503-0 [1st edition January 2004] http://oreilly.com/catalog/9780596005030/ Regular Expression Pocket Reference by Tony Stubblebine ISBN 978-0-596-51427-3 [July 2007] http://oreilly.com/catalog/9780596514273/ Tutorials Beginning Perl by James Lee ISBN 1-59059-391-X [3rd edition April 2010] http://www.apress.com/9781430227939 Learning Perl by Randal L. Schwartz, Tom Phoenix, and brian d foy ISBN 978-0-596-52010-6 [5th edition June 2008] http://oreilly.com/catalog/9780596520106 Intermediate Perl (the "Alpaca Book") by Randal L. Schwartz and brian d foy, with Tom Phoenix foreword by Damian Conway ISBN 0-596-10206-2 [1st edition March 2006] http://oreilly.com/catalog/9780596102067 Mastering Perl by brian d foy ISBN 978-0-596-10206-7 [1st edition July 2007] http://www.oreilly.com/catalog/9780596527242 Effective Perl Programming by Joseph N. Hall, Joshua A. McAdams, brian d foy ISBN 0-321-49694-9 [2nd edition 2010] http://www.effectiveperlprogramming.com/ Task-Oriented Writing Perl Modules for CPAN by Sam Tregar ISBN 1-59059-018-X [1st edition August 2002] http://www.apress.com/9781590590188 The Perl Cookbook by Tom Christiansen and Nathan Torkington with foreword by Larry Wall ISBN 1-56592-243-3 [2nd edition August 2003] http://oreilly.com/catalog/9780596003135 Automating System Administration with Perl by David N. Blank-Edelman ISBN 978-0-596-00639-6 [2nd edition May 2009] http://oreilly.com/catalog/9780596006396 Real World SQL Server Administration with Perl by Linchi Shea ISBN 1-59059-097-X [1st edition July 2003] http://www.apress.com/9781590590973 Special Topics Regular Expressions Cookbook by Jan Goyvaerts and Steven Levithan ISBN 978-0-596-52069-4 [May 2009] http://oreilly.com/catalog/9780596520694 Programming the Perl DBI by Tim Bunce and Alligator Descartes ISBN 978-1-56592-699-8 [February 2000] http://oreilly.com/catalog/9781565926998 Perl Best Practices by Damian Conway ISBN: 978-0-596-00173-5 [1st edition July 2005] http://oreilly.com/catalog/9780596001735 Higher-Order Perl by Mark-Jason Dominus ISBN: 1-55860-701-3 [1st edition March 2005] http://hop.perl.plover.com/ Mastering Regular Expressions by Jeffrey E. F. Friedl ISBN 978-0-596-52812-6 [3rd edition August 2006] http://oreilly.com/catalog/9780596528126 Network Programming with Perl by Lincoln Stein ISBN 0-201-61571-1 [1st edition 2001] http://www.pearsonhighered.com/educator/product/Network-Programming-with-Perl/9780201615715.page Perl Template Toolkit by Darren Chamberlain, Dave Cross, and Andy Wardley ISBN 978-0-596-00476-7 [December 2003] http://oreilly.com/catalog/9780596004767 Object Oriented Perl by Damian Conway with foreword by Randal L. Schwartz ISBN 1-884777-79-1 [1st edition August 1999] http://www.manning.com/conway/ Data Munging with Perl by Dave Cross ISBN 1-930110-00-6 [1st edition 2001] http://www.manning.com/cross Mastering Perl/Tk by Steve Lidie and Nancy Walsh ISBN 978-1-56592-716-2 [1st edition January 2002] http://oreilly.com/catalog/9781565927162 Extending and Embedding Perl by Tim Jenness and Simon Cozens ISBN 1-930110-82-0 [1st edition August 2002] http://www.manning.com/jenness Pro Perl Debugging by Richard Foley with Andy Lester ISBN 1-59059-454-1 [1st edition July 2005] http://www.apress.com/9781590594544 Free (as in beer) books Some of these books are available as free downloads. Higher-Order Perl: http://hop.perl.plover.com/ Other interesting, non-Perl books You might notice several familiar Perl concepts in this collection of ACM columns from Jon Bentley. The similarity to the title of the major Perl book (which came later) is not completely accidental: Programming Pearls by Jon Bentley ISBN 978-0-201-65788-3 [2 edition, October 1999] More Programming Pearls by Jon Bentley ISBN 0-201-11889-0 [January 1988] A note on freshness Each version of Perl comes with the documentation that was current at the time of release. This poses a problem for content such as book lists. There are probably very nice books published after this list was included in your Perl release, and you can check the latest released version at http://perldoc.perl.org/perlbook.html . Some of the books we've listed appear almost ancient in internet scale, but we've included those books because they still describe the current way of doing things. Not everything in Perl changes every day. Many of the beginner-level books, too, go over basic features and techniques that are still valid today. In general though, we try to limit this list to books published in the past five years. Get your book listed If your Perl book isn't listed and you think it should be, let us know. perl v5.16.3 2013-03-04 PERLBOOK(1)
All times are GMT -4. The time now is 11:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy