Sponsored Content
Full Discussion: fun and easy awk question
Top Forums UNIX for Dummies Questions & Answers fun and easy awk question Post 302490690 by glev2005 on Wednesday 26th of January 2011 09:24:48 AM
Old 01-26-2011
My File with Titles:
Code:
Close Range
VANISHED MAN 
Cold Moon 
1776
Creating Wealth 
Dante Club

File I want to find matches in with field separator being " so the title would be $2.. If found a match, I want to print the whole line from this file:
Code:
  d5of5 Vanished Man    9780743551717    "VANISHED MAN"    "DEAVER, JEFFERY"    2005
 CD01of10 1776UAB    9780743551779    "1776"    "MCCULLOUGH, DAVID"    2005

----------
the lines above should be printed to a newfile, because they matched with the first file.


I hope I am being clear, thanks for your help.

---------- Post updated 01-26-11 at 09:24 AM ---------- Previous update was 01-25-11 at 01:31 PM ----------

Please remove this thread

Last edited by glev2005; 01-25-2011 at 02:48 PM..
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

A easy question.

this is the simple question, please help me! the question is: how to send exactly 50 ICMP Echo request packets with 500 bytes of payload to 202.139.129.221? I tried to use ping -F 500 202.139.129.221, but it didn't work. Thanks! (6 Replies)
Discussion started by: kikikaka
6 Replies

2. UNIX for Dummies Questions & Answers

Easy question about awk gsub

How does one escape the left bracket in awk? For example: | awk 'gsub (" I'm sure it's pretty simple, I'm just a noob. (1 Reply)
Discussion started by: TheCrunge
1 Replies

3. Shell Programming and Scripting

Easy AWK question

Ive got some output in a file that looks exactly like this: 1 ----------- 1542 1 record(s) selected. How do I just extract that 1542 and drop it into another file or (preferrably) a variable (using a ksh script) (9 Replies)
Discussion started by: rdudejr
9 Replies

4. UNIX for Dummies Questions & Answers

easy question

Hi everybody: Could anybody tell me if I have several files which each one it has this pattern name: name1.dat name2.dat name3.dat name4.dat name10.dat name11.dat name30.dat If I would like create one like: name_total.dat If I do: paste name*.dat > name_total.dat (15 Replies)
Discussion started by: tonet
15 Replies

5. Shell Programming and Scripting

Fun with awk

uggc://ra.jvxvcrqvn.bet/jvxv/EBG13 #!/usr/bin/awk -f BEGIN { for (n=0;n<26;n++) { x=sprintf("%c",n+65); y=sprintf("%c",(n+13)%26+65) r=y; r=tolower(y) } } { b = "" for (n=1; x=substr($0,n,1); n++) b = b ((y=r)?y:x) print b } ... (0 Replies)
Discussion started by: colemar
0 Replies

6. Shell Programming and Scripting

More fun with awk

#!/usr/bin/ksh ls -l $@ | awk ' /^-/ { l = 5*log($5) h = sprintf("%7d %-72s",$5,$8) print "\x1B ls command with histogram of file sizes. The histogram scale is logaritmic, to avoid very short bars for smaller files or very long bars for bigger files. Screenshot: (4 Replies)
Discussion started by: colemar
4 Replies

7. Shell Programming and Scripting

awk Help: quick and easy question may be: How to use &&

Hi Guru's. I am trying to use to check if $5 is greater than 80 & if not 100, then to print $0 : awk '{ if ($5>80) && if ($5 != 100) print $0} But getting error: >bdf1|sed 's/%//g'|awk '{ if ($5>80) && if ($5 != 100) print $0}' syntax error The source line is 1. The error... (6 Replies)
Discussion started by: rveri
6 Replies

8. Shell Programming and Scripting

awk easy question

So, I have the following code: cat testfile.txt | awk -F, '{ print $1" "$2" "$3" "$4" "$5 }' | read DOC ORG NAME echo "$DOC" echo "$ORG" echo "$NAME" My testfile.txt looks something like the following: Document Type,Project Number,Org ID,Invoice Number It will eventually be more... (14 Replies)
Discussion started by: Parrakarry
14 Replies

9. Shell Programming and Scripting

awk diamond code golf (just for fun!)

Hey guys, This is purely just a little bit of fun with awk. I realize this this isn't that constructive so please remove if need be. Your goal: Create a one line awk script that generates a diamond shape of any size. Both the size of the diamond (measured by its middle line) and the... (7 Replies)
Discussion started by: pilnet101
7 Replies
DtMmdbBookGetTabList(library call)										DtMmdbBookGetTabList(library call)

NAME
DtMmdbBookGetTabList -- obtains the list of tab sections in a book SYNOPSIS
#include <DtMmdb.h> DtMmdbHandle** DtMmdbBookGetTabList( DtMmdbInfoRequest* request, unsigned int* length); DESCRIPTION
The DtMmdbBookGetTabList function returns the list of tab sections for the specified book object. It returns the list in a NULL-terminated array. Use the DtMmdbFreeHandleList function to release the memory when the array is no longer needed. Table lookup is involved when the identifier is specified by either the primary_oid or sequence_num field. ARGUMENTS
request Specifies the bookcase in the bookcase descriptor field, as well as a valid value in the primary_oid, the secondary_oid, or the sequence_num field. The primary_oid represents the DtInfo Database object identifier of the TOC section; the secondary_oid rep- resents the object identifier of the book itself; and the sequence_num represents the sequence number of the book within the bookcase (0 based). If more than one of these fields have a valid value, the order of precedence is: primary_oid, secondary_oid, and, last, sequence_num. length Specifies the variable to receive the length of the returned list of sections, if the returned pointer to the list is not NULL. RETURN VALUE
If DtMmdbBookGetTabList completes successfully, it returns a pointer to the list of sections for the book. If it fails, it returns a NULL pointer. EXAMPLE
None. SEE ALSO
TO BE SUPPLIED. DtMmdbBookGetTabList(library call)
All times are GMT -4. The time now is 09:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy