Sponsored Content
Full Discussion: Match words
Top Forums Shell Programming and Scripting Match words Post 302155980 by jaduks on Sunday 6th of January 2008 11:24:08 PM
Old 01-07-2008
A small one (in one line)

$ cat fileb | while read num
> do
> awk -F ":" '$1=="'"$num"'" {print $2}' filea
> done

And If you want to check for "NO MATCH FOUND" in filea(first file)

$ cat fileb | while read num
> do
> NAME=`awk -F ":" '$1=="'"$num"'" {print $2}' filea`
> [ -z $NAME ] && echo "NO MATCH FOUND" || echo $NAME
> done

//Jadu
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep on multiple words to match text template

hi, I have few text templates as a simple ex: template 1 city Name: zip code: state Name: template2: employee Name: Phone number: I wish to grep on given text file and make sure the text file matches one of these templates. Please give your ideas. (6 Replies)
Discussion started by: rider29
6 Replies

2. Shell Programming and Scripting

Print all the words after a match word

Hi, I want to print all words till the last word after the match of "ERROR" word. For e.g. I'll get an sqlplus error with e.g. 1 $ ./calltest_fn.ksh var test_var:=test_fn1; calltest_fn.ksh file1 file2 file3 ERROR at line 4: ORA-06550: line 4, column 11: PLS-00201: identifier... (5 Replies)
Discussion started by: dips_ag
5 Replies

3. Shell Programming and Scripting

printing words based on column match

pls help Input: file1 word1 text1 word2 text2 word3 text3 file2 word1 text11 word3 text13 can u pls help in getting the same output: file1 text1 text2 text3 (1 Reply)
Discussion started by: bha148
1 Replies

4. Shell Programming and Scripting

awk or grep to match # of words before and after pattern

Pipe binary file matches grep results to file I am using grep to match a pattern, but the output is strange. $ grep -r -o "pattern" * Gives me: Binary file foo1 matches Binary file foo2 matches Binary file foo3 matches To find the lines before/after, I then have to use the... (1 Reply)
Discussion started by: chipperuga
1 Replies

5. Shell Programming and Scripting

Count number of match words

Input: some random text SELECT TABLE1 some more random text some random text SELECT TABLE2 some more random text some random text SELECT TABLE3 some more random text some random text SELECT TABLE1 some more random text Output: 'SELECT TABLE1' 2 'SELECT TABLE2' 1 'SELECT TABLE3' 1 I... (5 Replies)
Discussion started by: chitech
5 Replies

6. Shell Programming and Scripting

Match groups of capital words using gawk

Hi I'd like to extract from a text file, using gawk, the groups of words beginning with a capital letter, that are not at the begining of a sentence (i.e. Not after a full stop and a pace ". "), including special characters like registered or trademark (® or ™ ). For example I would like to... (1 Reply)
Discussion started by: louisJ
1 Replies

7. Shell Programming and Scripting

Match the word or words and fetch the entries

Hi all, I have 7 words Now I have 1 file which contain data in large number of rows and columns and 6th column contain any of these words or may be more than one words among above 7 words: I want script should search for the above mentioned 7 words in the 6th column ... (9 Replies)
Discussion started by: manigrover
9 Replies

8. Shell Programming and Scripting

Match words and fetch data in front of it in second column

Hi all, I have 2 files one file contain data like this in one column AST3 GSTY4 JST3 second file containign data like this in 2 columns AST3(PAXXX),GSTY4(PAXXY) it is used in diabetes KST4 it is used in blood... (6 Replies)
Discussion started by: manigrover
6 Replies

9. Shell Programming and Scripting

Grep two words with exact match

HI Input : Counters Counter Int Ints Counters Counters Ints Ints I want to grep Counter|Int Output : Counter (1 Reply)
Discussion started by: pareshkp
1 Replies

10. Shell Programming and Scripting

Gawk gensub, match capital words and lowercase words

Hi I have strings like these : Vengeance mitt Men Vengeance gloves Women Quatro Windstopper Etip gloves Quatro Windstopper Etip gloves Girls Thermobite hooded jacket Thermobite Triclimate snow jacket Boys Thermobite Triclimate snow jacket and I would like to get the lower case words at... (2 Replies)
Discussion started by: louisJ
2 Replies
posttek(1)							   User Commands							posttek(1)

NAME
posttek - PostScript translator for Tektronix 4014 files SYNOPSIS
posttek [-c num] [-f name] [-m num] [-n num] [-o list] [-p mode] [-w num] [-x num] [-y num] [file...] /usr/lib/lp/postscript/posttek DESCRIPTION
The posttek filter translates Tektronix 4014 graphics files into PostScript and writes the results on the standard output. If no files are specified, or if - is one of the input files, the standard input is read. OPTIONS
-c num Print num copies of each page. By default, only one copy is printed. -f name Print text using font name. Any PostScript font can be used, although the best results will be obtained only with constant width fonts. The default font is Courier. -m num Magnify each logical page by the factor num. Pages are scaled uniformly about the origin which, by default, is located at the cen- ter of each page. The default magnification is 1.0. -n num Print num logical pages on each piece of paper, where num can be any positive integer. By default, num is set to 1. -o list Print pages whose numbers are given in the comma-separated list. The list contains single numbers N and ranges N1 - N2. A missing N1 means the lowest numbered page, a missing N2 means the highest. The page range is an expression of logical pages rather than physical sheets of paper. For example, if you are printing two logical pages to a sheet, and you specified a range of 4, then two sheets of paper would print, containing four page layouts. If you specified a page range of 3-4, when requesting two logical pages to a sheet; then only page 3 and page 4 layouts would print, and they would appear on one physical sheet of paper. -p mode Print files in either portrait or landscape mode. Only the first character of mode is significant. The default mode is landscape. -w num Set the line width used for graphics to num points, where a point is approximately 1/72 of an inch. By default, num is set to 0 points, which forces lines to be one pixel wide. -x num Translate the origin num inches along the positive x axis. The default coordinate system has the origin fixed at the center of the page, with positive x to the right and positive y up the page. Positive num moves everything right. The default offset is 0.0 inches. -y num Translate the origin num inches along the positive y axis. Positive num moves everything up the page. The default offset is 0.0. EXIT STATUS
The following exit values are returned: 0 Successful completion. non-zero An error occurred. FILES
/usr/lib/lp/postscript/forms.ps /usr/lib/lp/postscript/ps.requests ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWpsf | +-----------------------------+-----------------------------+ SEE ALSO
download(1), dpost(1), postdaisy(1), postdmd(1), postio(1), postmd(1), postprint(1), postreverse(1), attributes(5) NOTES
The default line width is too small for write-white print engines, such as the one used by the PS-2400. SunOS 5.10 9 Sep 1996 posttek(1)
All times are GMT -4. The time now is 06:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy