Here's is an example of what I want to do:
var1="Horse "
var2="Cat "
var3="Fish "
for animals in "$var1" "$var2" "$var3"
do
set $animals
pet=$1
## Ok, now I want to get the values of $pet, but
## I want to retain the full length it was... (3 Replies)
Is there a command that sets a variable length?
I have a input of a variable length field but my output for that field needs to be set to 32 char.
Is there such a command?
I am on a sun box running ksh
Thanks (2 Replies)
Hi experts.
I got a file (500mb max) and need to pivot it (loading into ORCL) and change BLANK delimiter to PIPE |.
Sometimes there are multipel BLANKS (as a particular value may be BLANK, or simply two BLANKS instead of one BLANK).
thanks for your input!
Cheers,
Layout... (3 Replies)
Hi I am new to shell scripting. I need to parse a file which contains the header and detail records and split into n of file based on dept ID, for ex.
INPUT FILE:
DEPT ID: 1
EMPNAME: XYZ
EMPAddress: XYZZZ
DEPT ID: 2
EMPNAME: ABC
EMPAddress: ABCD
DEPT ID: 1
EMPNAME: PQR
EMPAddress:... (6 Replies)
Hi,
I have a problem, please help me,
I have a flat file like this:
P00000000088888888999999999 0000999903 000000000000000000
P00000000077777777000000000 0000999903 000000000000000000
P00000000044444444333333333 0000999903 00000000000000000079875
P00000000066666666111111111 0000999903 ... (5 Replies)
Very, very new to unix scripting and have a unique situation. I have a file of records that contain 3 records types:
(H)eader Records
(D)etail Records
(T)railer Records
The Detail records are 82 bytes in length which is perfect. The Header and Trailer records sometimes are 82 bytes in... (3 Replies)
Hi,
Can anyone help with a effective solution ?
I need to change a variable length text field (between 1 - 18 characters) to a fixed length text of 18 characters with the unused portion, at the end, filled with spaces.
The text field is actually field 10 of a .csv file however I could cut... (7 Replies)
Hi,
The record length may be differ in afile. I want to display the records if the record length is not equal to 50 using sed/awk command.
Thanks in Advance (6 Replies)
Hi Team,
I have an issue to split the file which is having special chracter(German Char) using awk command.
I have a different length records in a file. I am separating the files based on the length using awk command.
The command is working fine if the record is not having any... (7 Replies)
Discussion started by: Anthuvan
7 Replies
LEARN ABOUT REDHAT
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)