Sponsored Content
Top Forums Shell Programming and Scripting Merge 2 files with one reference columns Post 302866599 by mv_mv on Tuesday 22nd of October 2013 11:24:25 AM
Old 10-22-2013
Thanks Akshay for the quick reply. Here is the output with your code

-------------------------------
Code:
servername1 patchid1,appname3
servername1 patchid2,appname3
servername1 patchid3,appname3
servername2 patchid1,appname4
servername2 patchid2,appname4
servername3 patchid4,appname10
servername3 patchid5,appname10

--------------------------------

As you can see, only the last appname from source2 is picked. Instead of 9 entries for servername1, only 3 merged lines are printed.

Thanks

Last edited by Scrutinizer; 10-22-2013 at 12:27 PM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Compare two files and merge columns in a third

Hi, I'm working with snmp, with a little script I'm able to obtain from a switch a list with a couple of values with this format Port Mac 1 00:0A:0B:0C:0D:0E .... (hundred of entries) Now with a simple arp on a router I am able to obtain another list 00:0A:0B:0C:0D:0E... (20 Replies)
Discussion started by: CM64
20 Replies

2. UNIX for Dummies Questions & Answers

compare columns from 2 files and merge

Dear all, Being new to Unix i have a problem. I have 2 files: File 1: 118,1,0,2,3,0,5,0.3,0,0.3,0.6,1 118,2,1,2,2,0,5,0.4,0,0.4,0.4,1 118,4,2,0,3,0,5,0.7,0,0.3,0.6,1 118,6,4,1,0,0,5,0.8,0,0.2,0,1 File 2: 118,1,BFGL-NGS-109695,3610326,0,18,1,0.556,0.389,0.056,0.25,0.8183... (2 Replies)
Discussion started by: samwilkinson
2 Replies

3. Shell Programming and Scripting

merge the two files which has contain columns

Hi may i ask how to accomplish this task: I have 2 files which has multiple columns first file 1 a 2 b 3 c 4 d second file 14 a 9 .... 13 b 10.... 12 c 11... 11 d 12... I want to merge the second file to first file that will looks like this ... (2 Replies)
Discussion started by: jao_madn
2 Replies

4. UNIX for Dummies Questions & Answers

Merge two files with two columns being similar

Hi everyone. How can I merge two files, where each file has 2 columns and the first columns in both files are similar? I want all in a file of 4 columns; join command removes the duplicate columns. 1 Dave 2 Mark 3 Paul 1 Apple 2 Orange 3 Grapes to get it like this in the 3rd file:... (9 Replies)
Discussion started by: Atrisa
9 Replies

5. Shell Programming and Scripting

Merge columns of different files

Hi, I have tab limited file 1 and tab limited file 2 The output should contain common first column vales and corresponding 2nd column values; AND also unique first column value with corresponding 2nd column value of the file that contains it and 0 for the second file. the output should... (10 Replies)
Discussion started by: polsum
10 Replies

6. UNIX for Dummies Questions & Answers

Merge columns from multiple files

Hi all, I've searched the web for a long time trying to figure out how to merge columns from multiple files. I know paste will append columns like so: paste file1 file2 file3 file4 file5 ... But this becomes inconvenient when you want to append a large number of files into a single file. ... (2 Replies)
Discussion started by: torchij
2 Replies

7. Shell Programming and Scripting

Merge columns on different files

Hello, I have two files that have this format: file 1 86.82 0.00 86.82 43.61 86.84 0.00 86.84 43.61 86.86 0.00 86.86 43.61 86.88 0.00 86.88 43.61 file 2 86.82 0.22 86.84 0.22 86.86 0.22 86.88 0.22 I would like to merge these two files such that the final file looks like... (5 Replies)
Discussion started by: kayak
5 Replies

8. Shell Programming and Scripting

Merge columns from multiple files

Hello and Good day I have a lot of files with same number of rows and columns.$2 and $3 are the same in all files . I need to merge $2,$3,$6 from first file and $6 from another files. File1: $1 $2 $3 $4 $5 $6... (8 Replies)
Discussion started by: ali.seifaddini
8 Replies

9. Shell Programming and Scripting

Merge files based on columns

011111123444 1234 1 20000 011111123444 1235 1 30000 011111123446 1234 3 40000 011111123447 1234 4 50000 011111123448 1234 3 50000 File2: 011111123444,Rsttponrfgtrgtrkrfrgtrgrer 011111123446,Rsttponrfgtrgtr 011111123447,Rsttponrfgtrguii 011111123448,Rsttponrfgtrgtjiiu I have 2 files... (4 Replies)
Discussion started by: vinus
4 Replies

10. Shell Programming and Scripting

Merge columns from two files using awk

I have two csv files : say a.csv, b.csv a.csv looks like this : property1,property2,100 property3,property4,200 In a.csv, the combination of column1 and column2 will be unique b.csv looks like this property1,property2, 300, t1 property1,property2, 400,t2 property3, property4,800,t1... (2 Replies)
Discussion started by: Lakshmikumari
2 Replies
ypserv(8yp)															       ypserv(8yp)

Name
       ypserv, ypbind - yellow pages (YP) server and binder processes

Syntax
       /usr/etc/ypserv
       /etc/ypbind [ -S domainname, servername1,servername2...	][ -X ]

Description
       The  yellow  pages (YP) service provides a network lookup service consisting of databases and processes.  The databases are files stored in
       the directory.  These files are described in The processes are the YP database lookup server, and the YP binder.  The software interface to
       the YP service is described in Administrative tools are described in and Tools to see the contents of YP maps are described in and Database
       generation and maintenance tools are described in and

       Both and are daemon processes activated at system startup time from The command runs only on a YP server machine with a complete  YP  data-
       base.  The command runs on all machines using YP services, both YP servers and clients.

       The  daemon's primary function is to look up information in its local database of YP maps.  The operations performed by are defined for the
       programmer in the header file

       Communication with is by means of RPC calls.  Lookup functions are described in and are supplied as C-callable functions in

       There are four lookup functions, all of which are performed on a specified map within a YP domain: and  The  operation  takes  a  key,  and
       returns	the  associated  value.  The operation returns the first key-value pair from the map, and the operation returns the remaining key-
       value pairs.  The operation ships the entire map to the requester.

       Two other functions supply information about the map, rather than the map entries: and Both the order number and the master name  exist	in
       the map as key-value pairs, but the server will not return either through the usual lookup functions.  If the map is examined with however,
       they are visible.

       Other functions are used within the YP subsystem itself, and are not of general interest to YP clients.	They include the the and the func-
       tions.

       The  purpose  of the function is to remember information that lets client processes on a single node communicate with a process.  The func-
       tion must run on every machine that has YP client service requirements.	The function must be started through an entry in the file.

       The information remembers is called a binding, the association of a domain name with the internet address of the YP server, and the port on
       that  host  at which the process is listening for service requests.  The process of binding is driven by client requests.  As a request for
       an unbound domain comes in, the process broadcasts on the net trying to find a process that serves maps	within	that  domain.	Since  the
       binding	is established by broadcasting, there must be at least one process on every net.  Once a domain is bound by a particular that same
       binding is given to every client process on the node.  The process on the local node or a remote node may be queried for the binding  of  a
       particular domain by using the command.

       Bindings  are  verified	before	they are given out to a client process.  If is unable to speak to the process it is bound to, it marks the
       domain as unbound, tells the client process that the domain is unbound, and tries to bind the domain once again.  Requests received for	an
       unbound	domain	will  fail immediately.  In general, a bound domain is marked as unbound when the node running crashes or gets overloaded.
       When the node gets overloaded, will try to bind any YP server (typically one that is less-heavily loaded) available on the net.

       The process also accepts requests to set its binding for a particular domain.  The request is usually generated by the YP subsystem itself.

Options
       -S	 Allows the system administrator to lock to a particular domain and set of servers. Up to four servers can be  specified  as  fol-
		 lows:
		 /etc/ypbind -S domainname,server1,server2,server3,server4
		 Note  that  there  can not be any spaces around the commas in the command line. The option ensures that this system only binds to
		 the specified domain and to one of the specified servers.  The servers used with the option must have entries in the local file.

       -X	 The initial bind ( option forces to bind to a YP server at the time that the command is executed, instead of waiting until YP	is
		 used.	If no server is available at this time, will try for several minutes and then exit.  Normally, is executed at boot time.

		 The  option  enables  a  system  that	does not exclusively depend on YP to boot and to allow logins when there are no YP servers
		 available.  Without this option, such a system hangs.

Files
       If the file exists when starts up, log information is written to when error conditions occur.

See Also
       ypcat(1yp), ypmatch(1yp), ypwhich(1yp), ypclnt(3yp), ypfiles(5yp), yppush(8yp), ypxfr(8yp)
       Guide to the Yellow Pages Service

																       ypserv(8yp)
All times are GMT -4. The time now is 03:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy