Sponsored Content
Top Forums Shell Programming and Scripting awk script to parse results from TWO files Post 302521283 by yinyuemi on Tuesday 10th of May 2011 07:26:01 PM
Old 05-10-2011
Code:
awk 'NR==FNR{a[$1]=$3;next}$3>a[$1]{print $1,$3-a[$1]}' A B
xyz 3
ijk 5

This User Gave Thanks to yinyuemi For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell Script Needed to Parse Results

Raw Results: results|192.168.2|192.168.2.1|general/udp|10287|Security Note|For your information, here is the traceroute from 192.168.2.24 to 192.168.2.1 : \n192.168.2.24\n192.168.2.1\n\n results|192.168.2|192.168.2.1|ssh (22/tcp)|22964|Security Note|An SSH server is running on this port.\n... (2 Replies)
Discussion started by: jroberson
2 Replies

2. Shell Programming and Scripting

Can awk do lookups to other files and process results

I know that 'brute-force' scripting could accomplish this with lots of cat/echo/cut/grep and more. But, because my real file has 800k records, and the matching files have 10-20k records, this is not time-possible or efficient. I have input file: > cat file_in... (4 Replies)
Discussion started by: joeyg
4 Replies

3. Shell Programming and Scripting

awk script giving unstable results

Hi all Here I came accross a situation which i am unable to reason out... snippet 1 psg ServTest | grep -v "grep" | grep -v "vi" | awk '{ pgm_name=$8 cmd_name="ServTest" gsub(/]*/,"",pgm_name) if(pgm_name==cmd_name) { print "ServTest Present =" cmd_name} }'... (10 Replies)
Discussion started by: Anteus
10 Replies

4. Shell Programming and Scripting

awk - Matching columns between 2 files and reordering results

I am trying to match 4 colums (first_name,last_name,dob,ssn) between 2 files and when there is an exact match I need to write out these matches to a new file with a combination of fields from file1 and file2. I've managed to come up with a way to match these 2 files based on the columns (see below)... (7 Replies)
Discussion started by: ambroze
7 Replies

5. Shell Programming and Scripting

AWK failing to parse on certain files

Dear Unix Gurus, need your expertise to help troubleshoot a certain problem i'm having. I crated a shell script which will ftp get 1 crash log from multiple servers (listed in a text file). Each log will then be parsed by calling an awk script. The problem is, for certain log its parsing... (7 Replies)
Discussion started by: tarj
7 Replies

6. Shell Programming and Scripting

awk help: Match data fields from 2 files & output results from both into 1 file

I need to take 2 input files and create 1 output based on matches from each file. I am looking to match field #1 in both files (Userid) and create an output file that will be a combination of fields from both file1 and file2 if there are any differences in the fields 2,3,4,5,or 6. Below is an... (5 Replies)
Discussion started by: ambroze
5 Replies

7. Shell Programming and Scripting

awk to parse huge files

Hello All, I have a situation as below: (1) Read a source file (a single file of 1.2 million rows in it ) (2) Read Destination files one by one and replace the content ( few fields in it ) with the corresponding matching field from source file. I tried as below: ( please note I am not... (4 Replies)
Discussion started by: panyam
4 Replies

8. Shell Programming and Scripting

awk parse snmp results

i run the command snmptable -v2c -c public myIP IF-MIB::ifTable the result look like this : SNMP table: IF-MIB::ifTable ifIndex ifDescr ifType ifMtu ifSpeed ifPhysAddress ifAdminStatus ifOperStatus 1 Unit: 1 Slot: 0 Port: 1... (7 Replies)
Discussion started by: wanttolearn1
7 Replies

9. Shell Programming and Scripting

Parse input of two files to be the same in awk

I have two files that I am going to use diff to find the differences but need to parse them before I do that. I have include the format of each file1 and file2 with the desired output of each (the first 5 fields in each file). The first file has a "chr" before the # that needs to be removed. I... (1 Reply)
Discussion started by: cmccabe
1 Replies

10. UNIX for Beginners Questions & Answers

Comparing 2 files using awk , not getting any results - C shell

I am using c shell and trying to compare 2 files using awk . But the below awk statement doesnt give any result. Pls. advise why am not getting the desired o/p with the corrected awk script. Need to acheive this solution in awk using C shell. awk 'FNR==NR{a++;next} {for(i in a) {if ( a=$0... (8 Replies)
Discussion started by: reach2khan
8 Replies
get-edid(1)						      General Commands Manual						       get-edid(1)

NAME
get-edid, parse-edid - read-edid tools to retrieve and interpret monitor specifications using the VESA VBE DDC protocol SYNOPSIS
get-edid | parse-edid get-edid > filename parse-edid < filename DESCRIPTION
The read-edid utility comprises two tools: get-edid and parse-edid. get-edid uses Linux's vm86(2) system call to enter virtual 8086 mode and perform Data Display Channel (DDC) transfers using the VESA BIOS Extensions (VBE) to retrieve information from monitors, including identification strings, supported sync ranges, available video modes, and video mode parameters. Such information is often useful for configuring X Window System servers such as XFree86. The data obtained by get-edid is in a binary format, so the parse-edid command is available to interpret it and generate a human-readable block of text information that can also be included in an XFree86 XF86Config file. It is customary to invoke get-edid and parse-edid together in a pipeline. get-edid and parse-edid accept no options, recognize no environment variables, read no input files, and create no output files. AUTHOR
get-edid and parse-edid were written by John Fremlin, Dan Hugo, and Martin Kavalec, using the LRMI (Linux Real-Mode Interface) library by Josh Vanderhoof. This manual page was written by Branden Robinson, originally for Debian GNU/Linux. SEE ALSO
vm86(2) John Fremlin's read-edid website <http://john.fremlin.de/programs/linux/read-edid/> at http://john.fremlin.de/programs/linux/read-edid/ Debian GNU/Linux 2002-10-03 get-edid(1)
All times are GMT -4. The time now is 05:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy