02-05-2012
The result seems to be the number of fields (pipe separated) that match the constant file. The question I have is: is there just one record in the constant file, or multiple records?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I have two files and data looks like this:
File1 Contents
#Field1,Field2
Dist_Center_file1.txt;21
Dist_Center_file3.txt;20
Dist_Center_file2.txt;20
File2 Contents (*** No Header ***)
Dist_Center_file1.txt;23
Dist_Center_file2.txt;20
Dist_Center_file3.txt;20
I have... (4 Replies)
Discussion started by: Hangman2
4 Replies
2. Shell Programming and Scripting
Hi unix gurus,
I have a urgent requirement, I need to write a AWK script to compare each fields in 2 files using AWK.
Basically my output should be like this.
file1
row|num1|num2|num3
1|one|two|three
2|one|two|three
file2
row|num1|num2|num3
1|one|two|three
2|one|two|four
... (5 Replies)
Discussion started by: rashmisb
5 Replies
3. Shell Programming and Scripting
Hi All,
Looking for a quick AWK script to output some differences between two files.
FILE1
device1 1.1.1.1 PINGS
device1 2.2.2.2 PINGS
FILE2
2862 SITE1 device1-prod 1.1.1.1 icmp - 0 ... (4 Replies)
Discussion started by: stacky69
4 Replies
4. Shell Programming and Scripting
Dear experts
I have files like
ABD : 5869 events, relative ratio : 1.173800E-01 , sum of ratios : 1.173800E-01
VBD : 12147 events, relative ratio : 2.429400E-01 , sum of ratios : 3.603200E-01
SDF : 17000 events, relative ratio : 3.400000E-01 , sum of ratios : 7.003200E-01
OIP: 14984... (9 Replies)
Discussion started by: Alkass
9 Replies
5. Shell Programming and Scripting
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
Hi,
I have two text files, compare column one in both the files and if it matches then the output should contain the id in column one, the number and the description.
Both the files are sorted. Is there a one liner to get this done, kindly help. Thank you
File 1:
NC_000964 92.33 ... (2 Replies)
Discussion started by: pulikoti
2 Replies
7. Shell Programming and Scripting
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
8. UNIX for Dummies Questions & Answers
I am trying to compare two files (separted by a pipe) using 2 fields (field 1,3 from fileA and 1,2 from fileB) if the two files match i want the whole record of fileA adding the extra fields left from fileB.
1. A.txt
cat|floffy|12|anything|anythings
cat|kitty|15|lala|lalala... (6 Replies)
Discussion started by: sabercats
6 Replies
9. Shell Programming and Scripting
Hi,
I am trying to check two files based on certain string and field.
cat f1
source=\GREP\"
hi this \\
source=\SED\"
skdmsmd
dnksdns
source=\PERL\"
cat f2
source=\SED\"
source=\GREP\"
vlamskds
amdksk m
source=\AWK\"
awk \here\" (3 Replies)
Discussion started by: greet_sed
3 Replies
10. UNIX for Beginners Questions & Answers
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
LEARN ABOUT HPUX
xmresolvepartoffsets
XmResolvePartOffsets(library call) XmResolvePartOffsets(library call)
NAME
XmResolvePartOffsets -- A function that allows writing of upward-compatible applications and widgets
SYNOPSIS
#include <Xm/Xm.h>
void XmResolvePartOffsets(
WidgetClass widget_class,
XmOffsetPtr * offset);
DESCRIPTION
The use of offset records requires one extra global variable per widget class. The variable consists of a pointer to an array of offsets
into the widget record for each part of the widget structure. The XmResolvePartOffsets function allocates the offset records needed by an
application to guarantee upward-compatible access to widget instance records by applications and widgets. These offset records are used by
the widget to access all of the widget's variables. A widget needs to take the steps described in the following paragraphs.
Instead of creating a resource list, the widget creates an offset resource list. To accomplish this, use the XmPartResource structure and
the XmPartOffset macro. The XmPartResource data structure looks just like a resource list, but instead of having one integer for its off-
set, it has two shorts. This structure is put into the class record as if it were a normal resource list. Instead of using XtOffset for
the offset, the widget uses XmPartOffset.
XmPartResource resources[] = {
{ BarNxyz, BarCXyz, XmRBoolean,
sizeof(Boolean), XmPartOffset(Bar,xyz),
XmRImmediate, (XtPointer)False }
};
Instead of putting the widget size in the class record, the widget puts the widget part size in the same field.
Instead of putting XtVersion in the class record, the widget puts XtVersionDontCheck in the class record.
The widget defines a variable, of type XmOffsetPtr, to point to the offset record. This can be part of the widget's class record or a sep-
arate global variable.
In class initialization, the widget calls XmResolvePartOffsets, passing it a pointer to contain the address of the offset record and the
class record. This does several things:
o Adds the superclass (which, by definition, has already been initialized) size field to the part size field
o Allocates an array based upon the number of superclasses
o Fills in the offsets of all the widget parts with the appropriate values, determined by examining the size fields of all superclass
records
o Uses the part offset array to modify the offset entries in the resource list to be real offsets, in place
The widget defines a constant that will be the index to its part structure in the offsets array. The value should be 1 greater than the
index of the widget's superclass. Constants defined for all Xm widgets can be found in XmP.h.
#define BarIndex (XmBulletinBIndex + 1)
Instead of accessing fields directly, the widget must always go through the offset table. The XmField macro helps you access these fields.
Because the XmPartOffset and XmField macros concatenate things together, you must ensure that there is no space after the part argument.
For example, the following macros do not work because of the space after the part (Label) argument:
XmField(w, offset, Label, text, char *)
XmPartOffset(Label, text)
Therefore, you must not have any spaces after the part (Label) argument, as illustrated here:
XmField(w, offset, Label, text, char *)
You can define macros for each field to make this easier. Assume an integer field xyz:
#define BarXyz(w) (*(int *)(((char *) w) +
offset[BarIndex] + XtOffset(BarPart,xyz)))
The parameters for XmResolvePartOffsets are
widget_class
Specifies the widget class pointer for the created widget
offset Returns the offset record
RELATED INFORMATION
XmResolveAllPartOffsets(3).
XmResolvePartOffsets(library call)