Sponsored Content
Top Forums Shell Programming and Scripting Compare two files based on values of fields. Post 302464957 by Hangman2 on Thursday 21st of October 2010 10:43:55 AM
Old 10-21-2010
Tools Diff in count between 2 flat files

Hi I have 2 flat files and want to get count diff w/o counting the header meant one file has header and other don't have one.so if first file has 10 count and second has 11 (with header) ,how can i acheive this.Simply getting count after header(#Date,Quantity'10/26/2010';123)
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Compare two files using awk or sed, add values in a column if their previous fields are same

Hi All, I have two files file1: abc,def,ghi,5,jkl,mno pqr,stu,ghi,10,vwx,xyz cba,ust,ihg,4,cdu,oqw file2: ravi,def,kishore ramu,ust,krishna joseph,stu,mike I need two output files as follows In my above example, each row in file1 has 6 fields and each row in file2 has 3... (1 Reply)
Discussion started by: yerruhari
1 Replies

2. UNIX for Dummies Questions & Answers

Compare two files using awk or sed, add values in a column if their previous fields are same

Hi All, I have two files file1: abc,def,ghi,5,jkl,mno pqr,stu,ghi,10,vwx,xyz cba,ust,ihg,4,cdu,oqw file2: ravi,def,kishore ramu,ust,krishna joseph,stu,mike I need two output files as follows In my above example, each row in file1 has 6 fields and each row in file2 has 3... (1 Reply)
Discussion started by: yerruhari
1 Replies

3. Shell Programming and Scripting

Compare two files using awk or sed, add values in a column if their previous fields are same

Hi All, I have two files file1: abc,def,ghi,5,jkl,mno pqr,stu,ghi,10,vwx,xyz cba,ust,ihg,4,cdu,oqw file2: ravi,def,kishore ramu,ust,krishna joseph,stu,mike I need two output files as follows In my above example, each row in file1 has 6 fields and each row in file2 has 3... (3 Replies)
Discussion started by: yerruhari
3 Replies

4. UNIX for Dummies Questions & Answers

Compare two flat files and update one based on the values in the other

Hi, I'm a newbie to scripting and am trying to compare two files using awk. The files are exactly the same dimensions. Where the first file has 0's I would like to create an updated version of the second file which has the corresponding elements set to zero also. eg: file1: 12345 1 2 0... (3 Replies)
Discussion started by: kasan0
3 Replies

5. Shell Programming and Scripting

compare fields in different files

HI I'm having some troubles to compare and permut diffrent fields indexed with another filed like the following example `: file1 1 1 2 2 3 3 file2 7 1 9 2 10 3 result------------------- (6 Replies)
Discussion started by: yassinegoth
6 Replies

6. Shell Programming and Scripting

Compare fields in files

Hi, I need the most efficient way of comparing the following and arriving at the result I have a file which has entries like, File1: 1|2|5|7|8|2|3|6|3|1 File2: 1|2|3|1|2|7|9|2 I need to compare the entries in these two file with those of a general file, 1|2|3|5|2|5|6|9|3|1... (7 Replies)
Discussion started by: pradebban
7 Replies

7. Shell Programming and Scripting

Compare values in two files. For matching rows print corresponding values from File 1 in File2.

- I have two files (File 1 and File 2) and the contents of the files are mentioned below. - I am trying to compare the values of Column1 of File1 with Column1 of File2. If a match is found, print the corresponding value from Column2 of File1 in Column5 of File2. - I tried to modify and use... (10 Replies)
Discussion started by: Santoshbn
10 Replies

8. UNIX for Dummies Questions & Answers

Compare values of fields from same column with awk

Hi all ! If there is only one single value in a column (e.g. column 1 below), then return this value in the same output column. If there are several values in the same column (e.g. column 2 below), then return the different values separated by "," in the output. pipe-separated input: ... (11 Replies)
Discussion started by: lucasvs
11 Replies

9. Shell Programming and Scripting

Compare three files based on two fields

Guys, I tried searching on the internet and I couldn't get the answer for this problem. I have 3 files. First 2 fields of all of them are of same type, say they come from various databases but first two fields in the 3 files means the same. I need to verify the entries that are not present... (4 Replies)
Discussion started by: PikK45
4 Replies

10. UNIX for Beginners Questions & Answers

Is there a UNIX command that can compare fields of files with differing number of fields?

Hi, Below are the sample files. x.txt is from an Excel file that is a list of users from Windows and y.txt is a list of database account. $ head -500 x.txt y.txt ==> x.txt <== TEST01 APP_USER_PROFILE USER03 APP_USER_PROFILE TEST02 APP_USER_EXP_PROFILE TEST04 APP_USER_PROFILE USER01 ... (3 Replies)
Discussion started by: newbie_01
3 Replies
GELF_NEWPHDR(3) 					   BSD Library Functions Manual 					   GELF_NEWPHDR(3)

NAME
elf32_newphdr, elf64_newphdr, gelf_newphdr -- allocate an ELF program header table LIBRARY
ELF Access Library (libelf, -lelf) SYNOPSIS
#include <libelf.h> Elf32_Phdr * elf32_newphdr(Elf *elf, size_t count); Elf64_Phdr * elf64_newphdr(Elf *elf, size_t count); #include <gelf.h> void * gelf_newphdr(Elf *elf, size_t count); DESCRIPTION
These functions allocate an ELF Program Header table for an ELF descriptor. Elf32_Phdr and Elf64_Phdr descriptors are described further in elf(5). Functions elf32_newphdr() and elf64_newphdr() allocate a table of count Elf32_Phdr and Elf64_Phdr descriptors respectively, discarding any existing program header table already present in the ELF descriptor elf. A value of zero for argument count may be used to delete an exist- ing program header table from an ELF descriptor. Function gelf_newphdr() will return a table of Elf32_Phdr or Elf64_Phdr with count elements depending on the ELF class of ELF descriptor elf. The functions set the ELF_F_DIRTY flag on the program header table. All members of the returned array of Phdr structures will be initialized to zero. After a successful call to these functions, the pointer returned by a prior call to elf32_getphdr() or elf64_getphdr() on the same descriptor elf will no longer be valid. RETURN VALUES
The functions a valid pointer if successful, or NULL in case an error was encountered. ERRORS
These functions may fail with the following errors: [ELF_E_ARGUMENT] Argument elf was NULL. [ELF_E_ARGUMENT] Argument elf was not a descriptor for an ELF object. [ELF_E_CLASS] ELF descriptor elf was of an unrecognized class. [ELF_E_RESOURCE] An out of memory condition was detected. [ELF_E_SEQUENCE] An executable header was not allocated for ELF descriptor elf before using these APIs. SEE ALSO
elf(3), elf32_getphdr(3), elf32_newehdr(3), elf64_getphdr(3), elf64_newehdr(3), elf_flagphdr(3), elf_getphnum(3), gelf(3), gelf_getphdr(3), gelf_newehdr(3), elf(5) BSD
October 22, 2007 BSD
All times are GMT -4. The time now is 05:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy