Sponsored Content
Full Discussion: File comparison using awk
Top Forums Shell Programming and Scripting File comparison using awk Post 302895460 by mohanalakshmi on Tuesday 1st of April 2014 01:00:48 AM
Old 04-01-2014
Thanks for the reply and its working perfectly as expected.
Thanks again.SmilieCould you please explain how the code works.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Comparison of two files in awk

Hi, I have two files file1 and file2 delimited by semicolon, And I want to compare column 2 and column3 of file1 to column3 and column 4 in file2. file1 -------- abc;cef;155.67;143_34; def;fgh;146.55;123.3; frg;hff;134.67;; yyy;fgh;134.78;35_45; file 2 --------- abc;cef;155.09;;... (12 Replies)
Discussion started by: jerome Sukumar
12 Replies

2. Shell Programming and Scripting

awk program for file comparison

Hello there, I'm trying to write an awk program in bash shell with the following three input files: File 1 1001 1 2 3 1002 4 5 6 1003 7 8 9 1004 10 11 12 File 2 1001 11 22 33 1002 44 55 66 1004 100 111 122 ... (4 Replies)
Discussion started by: kbirde
4 Replies

3. Shell Programming and Scripting

Looking for AWK Solution for column comparison in a single file

- I am looking for different kind of awk solution which I don't think is mentioned before in these forums. Number of rows in the file are fixed Their are two columns in file1.txt 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 I am looking for 3... (1 Reply)
Discussion started by: softwarekids23
1 Replies

4. Shell Programming and Scripting

Comparison and editing of files using awk.(And also a possible bug in awk for loop?)

I have two files which I would like to compare and then manipulate in a way. File1: pictures.txt 1.1 1.3 dance.txt 1.2 1.4 treehouse.txt 1.3 1.5 File2: pictures.txt 1.5 ref2313 1.4 ref2345 1.3 ref5432 1.2 ref4244 dance.txt 1.6 ref2342 1.5 ref2352 1.4 ref0695 1.3 ref5738 1.2... (1 Reply)
Discussion started by: linuxkid
1 Replies

5. Shell Programming and Scripting

awk comparison

Hello all, Probably a very simple question, I am stuck with a small part of a code: I am trying to do a comparison to get the maximum value of column 6 if columns 1, 4 and 5 of two or more rows match. Here is what I am doing: awk -F'\t' '{if ($6 > a)a=$6}END{for (i in a) print i"\t"a}' ... (4 Replies)
Discussion started by: jaysean
4 Replies

6. Shell Programming and Scripting

awk column comparison big file

Hi all, I would like to compare a column in one file to a column in another file and when there is a match it prints the first column and the corresponding second column. Example File1 ABA ABC ABE ABF File 2 ABA 123 ABB 124 ABD 125 ABC 126 So what I would like printed to a... (6 Replies)
Discussion started by: pcg
6 Replies

7. Shell Programming and Scripting

Urgent Help Required for File Comparison using Awk

Hello All, I am having a below requirement. File1 contains KEY|VIN|SEQUENCE|COST 101 | XXX111 | 1 | 234.22 234 | XXX111 | 2 | 134.32 444 | ABC234 | 1 | 100.22 555 | DFF611 | 1 | 734.82 FILE 2 Contains only VINs XXX111 DFF611 Now if the VIN from file 1 is present in... (8 Replies)
Discussion started by: dinesh1985
8 Replies

8. Shell Programming and Scripting

awk file comparison, x lines after matching as output

Hello, I couldn't find anything on the Forum that would help me to solve this problem. Could any body help me process below data using awk? I have got two files: file1: Worker1: Thomas Position: Manager Department: Sales Salary: $5,000 Worker2: Jason Position: ... (5 Replies)
Discussion started by: killerbee
5 Replies

9. Shell Programming and Scripting

File comparison using awk

my files are as follows fileA sepearated by tab /t 00 lieferungen 00 attractiop 01 done 02 forness 03 rasp 04 alwaysisng 04 funny 05 done1 fileB funnymou120112 funnymou234470 mou3raspnhdhv rddfgmoudone1438748 so all those record which are greater than 3 and which are not... (6 Replies)
Discussion started by: rajniman
6 Replies

10. Shell Programming and Scripting

File comparison and proccessing using awk

Hi Guys, I am having two requirement in one of my scripts. please help out to find a fast solution using AWK (since there is lot of data to be processed) 1) First snippet - File1 has two columns and file2 has three columns If any value of column 1 of file1 matches with column 1... (4 Replies)
Discussion started by: stormfield
4 Replies
comm_wire(3tcl) 					       Remote communication						   comm_wire(3tcl)

__________________________________________________________________________________________________________________________________________________

NAME
comm_wire - The comm wire protocol SYNOPSIS
package require comm _________________________________________________________________ DESCRIPTION
The comm command provides an inter-interpreter remote execution facility much like Tk's send(3tk), except that it uses sockets rather than the X server for the communication path. As a result, comm works with multiple interpreters, works on Windows and Macintosh systems, and provides control over the remote execution path. This document contains a specification of the various versions of the wire protocol used by comm internally for the communication between its endpoints. It has no relevance to users of comm, only to developers who wish to modify the package, write a compatible facility in a different language, or some other facility based on the same protocol. WIRE PROTOCOL VERSION 3 BASIC LAYER The basic encoding for all data is UTF-8. Because of this binary data, including the NULL character, can be sent over the wire as is, with- out the need for armoring it. BASIC MESSAGE LAYER On top of the Basic Layer we have a message oriented exchange of data. The totality of all characters written to the channel is a Tcl list, with each element a separate message, each itself a list. The messages in the overall list are separated by EOL. Note that EOL char- acters can occur within the list as well. They can be distinguished from the message-separating EOL by the fact that the data from the beginning up to their location is not a valid Tcl list. EOL is signaled through the linefeed character, i.e LF, or, hex 0x0a. This is following the unix convention for line-endings. As a list each message is composed of words. Their meaning depends on when the message was sent in the overall exchange. This is described in the upcoming sections. NEGOTIATION MESSAGES - INITIAL HANDSHAKE The command protocol is defined like this: o The first message send by a client to a server, when opening the connection, contains two words. The first word is a list as well, and contains the versions of the wire protocol the client is willing to accept, with the most preferred version first. The second word is the TCP port the client is listening on for connections to itself. The value 0 is used here to signal that the client will not listen for connections, i.e. that it is purely for sending commands, and not receiving them. o The first message sent by the server to the client, in response to the message above contains only one word. This word is a list, containing the string vers as its first element, and the version of the wire protocol the server has selected from the offered ver- sions as the second. SCRIPT/COMMAND MESSAGES All messages coming after the initial handshake consist of three words. These are an instruction, a transaction id, and the payload. The valid instructions are shown below. The transaction ids are used by the client to match any incoming replies to the command messages it sent. This means that a server has to copy the transaction id from a command message to the reply it sends for that message. send async command The payload is the Tcl script to execute on the server. It is actually a list containing the script fragments. These fragment are concatenated together by the server to form the full script to execute on the server side. This emulates the Tcl "eval" semantics. In most cases it is best to have only one word in the list, a list containing the exact command. Examples: (a) {send 1 {{array get tcl_platform}}} (b) {send 1 {array get tcl_platform}} (c) {send 1 {array {get tcl_platform}}} are all valid representations of the same command. They are generated via (a') send {array get tcl_platform} (b') send array get tcl_platform (c') send array {get tcl_platform} respectively Note that (a), generated by (a'), is the usual form, if only single commands are sent by the client. For example constructed using list, if the command contains variable arguments. Like send [list array get $the_variable] These three instructions all invoke the script on the server side. Their difference is in the treatment of result values, and thus deter- mines if a reply is expected. send A reply is expected. The sender is waiting for the result. async No reply is expected, the sender has no interest in the result and is not waiting for any. command A reply is expected, but the sender is not waiting for it. It has arranged to get a process-internal notification when the result arrives. reply Like the previous three command, however the tcl script in the payload is highly restricted. It has to be a syntactically valid Tcl return command. This contains result code, value, error code, and error info. Examples: {reply 1 {return -code 0 {}}} {reply 1 {return -code 0 {osVersion 2.4.21-99-default byteOrder littleEndian machine i686 platform unix os Linux user andreask wordSize 4}}} BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category comm of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. SEE ALSO
comm KEYWORDS
comm, communication, ipc, message, remote communication, remote execution, rpc, socket CATEGORY
Programming tools COPYRIGHT
Copyright (c) 2005 Docs. Andreas Kupries <andreas_kupries@users.sourceforge.net> comm 3 comm_wire(3tcl)
All times are GMT -4. The time now is 01:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy