Sponsored Content
Full Discussion: lookup in unix
Top Forums UNIX for Dummies Questions & Answers lookup in unix Post 302220131 by Annihilannic on Thursday 31st of July 2008 02:03:34 AM
Old 07-31-2008
Code:
awk -F, -v OFS=, '
    # load array with changed client numbers
    NR==FNR { client_num[$1]=$2; next }
    # if this client has changed, print updated record
    $1 in client_num { print $1,client_num[$1]; next }
    # otherwise just print the current record
    1
' file_with_changes originalfile > newfile


Last edited by Annihilannic; 07-31-2008 at 03:04 AM.. Reason: forgot OFS
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Unix 8.2 and reverse Lookup

We have Unix configured as our external DNS, forward DNS is working properly, however Reverse lookup is not working. Any idea what the problem is? I have checked the named.boot and .rev file and everything seems to be correctly. However it appears that the reverse zone file in the named.boot... (2 Replies)
Discussion started by: cassy
2 Replies

2. UNIX for Dummies Questions & Answers

Lookup with a file

Hi All, i have a variable which has a value in it. RETAILER='JEWL' i have a text file. Name: file.txt file.txt ________ WLG 150 JEWL 60 CVS 240 FLN 120 WND 120 I am trying to write a korn script.the script, based on the value in the RETAILER will do a look up against the... (5 Replies)
Discussion started by: pavan_test
5 Replies

3. Shell Programming and Scripting

lookup in unix

Hi All I have got a fixed length file of 80bytes long.The first 4bytes of each record represents a client_number.I need to modify the client number based on another lookup file. The lookup file contains 2 fields and a comma delimited file.The first line of the lookup file contains the header... (5 Replies)
Discussion started by: dr46014
5 Replies

4. UNIX for Advanced & Expert Users

Clueless about how to lookup and reverse lookup IP addresses under a file!!.pls help

Write a quick shell snippet to find all of the IPV4 IP addresses in any and all of the files under /var/lib/output/*, ignoring whatever else may be in those files. Perform a reverse lookup on each, and format the output neatly, like "IP=192.168.0.1, ... (0 Replies)
Discussion started by: choco4202002
0 Replies

5. Shell Programming and Scripting

lookup

I have a lookup file in unix say /data/lkp.dat (First line is header and space delimited) and the content is shown below. Another file which contains the job_name and rec_count lets say /data/data_file.dat(no header pipe delimited file). Now i want to do a lookup on job_name and my output should... (3 Replies)
Discussion started by: dr46014
3 Replies

6. UNIX for Dummies Questions & Answers

Checking for unix hosts that do not have reverse lookup

Hi there i am not sure how to explain my problem. i need to run a script to give me the results of all my unix hosts that do not have reverse lookup activated (for lack of a better word), i need to give this to out Server guys to add it part of the AD rules. So what i need is a script to... (0 Replies)
Discussion started by: brian112
0 Replies

7. UNIX for Dummies Questions & Answers

Lookup in Unix

Hi, I have an input file which contain below records: a,1 b,2 c,3 a,10 b,34 i have a reference file which contains below records: a,AA b,BB c,CC My required output is : (3 Replies)
Discussion started by: pandeesh
3 Replies

8. Shell Programming and Scripting

Lookup name from another file

Hi All, I want to lookup name for an id in col2 input from another file and add the name to each line. Input 1 comp100001_c0_seq1 At1g31340 30.40 569 384 11 3 1673 313 834 7e-62 237 comp100003_c0_seq1 At1g35370_2 35.00 80 50 ... (7 Replies)
Discussion started by: gina.lizar
7 Replies

9. Shell Programming and Scripting

Lookup field values in two fixed format file in UNIX - not working

I have 2 fixed length files input#1 & input#2. I want to match the rows based on the value in position 37-50 in both files (pos 37-50 will have same value in both files). If any matching record is found then cut the value against company code & Invoice number from input file #1 (position 99 until... (3 Replies)
Discussion started by: Lingaraju
3 Replies

10. Shell Programming and Scripting

Array V-Lookup using UNIX bash

Hey everyone, I am trying to extract column values from a column in a tab-delimited text file and overlay them in a 2nd tab-delimited text file using a V-lookup type script in Unix bash. These are the 1st few rows of the 1st input file IN1: rsid chromosome position allele1 ... (10 Replies)
Discussion started by: Geneanalyst
10 Replies
SOCKETMAP_TABLE(5)						File Formats Manual						SOCKETMAP_TABLE(5)

NAME
socketmap_table - Postfix socketmap table lookup client SYNOPSIS
postmap -q "string" socketmap:inet:host:port:name postmap -q "string" socketmap:unix:pathname:name postmap -q - socketmap:inet:host:port:name <inputfile postmap -q - socketmap:unix:pathname:name <inputfile DESCRIPTION
The Postfix mail system uses optional tables for address rewriting. mail routing or policy lookup. The Postfix socketmap client expects TCP endpoint names of the form inet:host:port:name, or UNIX-domain endpoints of the form unix:path- name:name. In both cases, name specifies the name field in a socketmap client request (see "REQUEST FORMAT" below). PROTOCOL
Socketmaps use a simple protocol: the client sends one request, and the server sends one reply. Each request and each reply are sent as one netstring object. REQUEST FORMAT
The socketmap protocol supports only the lookup request. The request has the following form: name <space> key Search the named socketmap for the specified key. Postfix will not generate partial search keys such as domain names without one or more subdomains, network addresses without one or more least-significant octets, or email addresses without the localpart, address extension or domain portion. This behavior is also found with cidr:, pcre:, and regexp: tables. REPLY FORMAT
The Postfix socketmap client requires that replies are not longer than 100000 characters (not including the netstring encapsulation). Replies must have the following form: OK <space> data The requested data was found. NOTFOUND <space> The requested data was not found. TEMP <space> reason TIMEOUT <space> reason PERM <space> reason The request failed. The reason, if non-empty, is descriptive text. SECURITY
This map cannot be used for security-sensitive information, because neither the connection nor the server are authenticated. SEE ALSO
http://cr.yp.to/proto/netstrings.txt, netstring definition postconf(1), Postfix supported lookup tables postmap(1), Postfix lookup table manager regexp_table(5), format of regular expression tables pcre_table(5), format of PCRE tables cidr_table(5), format of CIDR tables README FILES
Use "postconf readme_directory" or "postconf html_directory" to locate this information. DATABASE_README, Postfix lookup table overview BUGS
The protocol limits are not yet configurable. LICENSE
The Secure Mailer license must be distributed with this software. HISTORY
Socketmap support was introduced with Postfix version 2.10. AUTHOR(S) Wietse Venema IBM T.J. Watson Research P.O. Box 704 Yorktown Heights, NY 10598, USA Wietse Venema Google, Inc. 111 8th Avenue New York, NY 10011, USA SOCKETMAP_TABLE(5)
All times are GMT -4. The time now is 05:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy