Hello, I have a file, and one column has both positive and negative numbers. Does anyone know how I can calculate the total of all the values (i.e, +ve and -ve).
eg:
col1 col2 col3
data 23 data
data 76 data
data -30 data
Thanks
Khoom (1 Reply)
i know how to add two numbers using expr,
but if i have a file with hundreds of numbers, how do i add them all together, without typing them all one by one?
for example, file.txt contains
4
5
6
7
how can i give a command to add them, without typing
$ expr `4 + 5 + 6 + 7` (7 Replies)
Hi this is quite a simple question... I am new to LINUX/UNIX and so I am just trying to create a very basic program. The idea is that when the user runs the program (from the shell) they enter 3 values and the program will add them up:
"./sum 23 5 1
29"
my code for this program is as follows:
... (4 Replies)
Hi
I figured how to add my list of numbers. However how do I count so that after a certain number it lists the line.
Example:
12 test1
46 test2
195 test3
174 test4
634 test5
185 test6
94 test7
So basically add the numbers and when the addition reaches 300 or less
print the... (8 Replies)
I have a file which has following contents which I want to add up.
28170.24
28170.24
28170.24
28170.24
28170.24
28170.24
28170.24
28170.24
28170.24
28170.24
28170.24
28170.24
28170.24
28170.24
139038.72
139038.72
139038.72
139038.72 (5 Replies)
Hello. Trying to add a column of numbers and combine the 1st and 2nd fields as uniq with the new total.
This works to add the numbers but can't figure an easy was to combine the 1st and 2nd column as the list is very long. awk '{s+=$3} END {print s}'
bird dog 300
bird dog 100
cat clown 200... (1 Reply)
Hi again. Sorry for all the questions — I've tried to do all this myself but I'm just not good enough yet, and the help I've received so far from bartus11 has been absolutely invaluable. Hopefully this will be the last bit of file manipulation I need to do.
I have a file which is formatted as... (4 Replies)
Hi Folks,
I have a file with 2 columns TAB delimited and I want to add '1' to the first column and subtract '-1' from the second column.
What I have tried so far is;
awk -F"\t" '{ $1-=1;$2+=1}1' OFS='\t' file
File
0623 0623
0624 0624
0643 0643
1059 1037
1037 1037
1038 1038... (2 Replies)
Hi All,
Could you please help me on this requirement.
File data:
A
A
A
B
B
B
i need the output like
A1
A2
A3
B1 (3 Replies)
Discussion started by: bmk123
3 Replies
LEARN ABOUT OSF1
xgetdevicedontpropagatelist
XChangeDeviceDontPropagateList(3X11)XChangeDeviceDontPropagateList(3X11)NAME
XChangeDeviceDontPropagateList, XGetDeviceDontPropagateList - query or change the dont-propagate-list for extension devices
SYNOPSIS
XChangeDeviceDontPropagateList(display, window, count, event_list, mode)
Display *display;
Window *window;
int *count;
XEventClass *event_list;
int mode;
XEventClass *XGetDeviceDontPropagateList(display, window, count)
Display *display;
Window *window;
int *count;
ARGUMENTS
Specifies the connection to the X server. Specifies the window whose dont-propagate-list is to be queried or modified. Specifies a
pointer to a list of event classes. Specifies the mode. You can pass AddToList, or DeleteFromList. Specifies the number of event classes
in the list.
DESCRIPTION
The XChangeDeviceDontPropagateList request modifies the list of events that should not be propagated to ancestors of the event window. This
request allows extension events to be added to or deleted from that list. By default, all events are propagated to ancestor windows. Once
modified, the list remains modified for the life of the window. Events are not removed from the list because the client that added them has
terminated.
Suppression of event propagation is not allowed for all input extension events. If a specified event class is one that cannot be sup-
pressed, a BadClass error will result. Events that can be suppressed include DeviceKeyPress, DeviceKeyRelease, DeviceButtonPress, Device-
ButtonRelease, DeviceMotionNotify, ProximityIn, and ProximityOut.
XChangeDeviceDontPropagateList can generate a BadDevice, BadClass, or BadValue error.
The XGetDeviceDontPropagateList request queries the list of events that should not be propagated to ancestors of the event window.
XGetDeviceDontPropagateList can generate a BadClass or BadWindow error.
DIAGNOSTICS
An invalid device was specified. The specified device does not exist or has not been opened by this client via XOpenInputDevice. This
error may also occur if some other client has caused the specified device to become the X keyboard or X pointer device via the XChangeKey-
boardDevice or XChangePointerDevice requests. Some numeric value falls outside the range of values accepted by the request. Unless a spe-
cific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of
alternatives can generate this error. An invalid window id was specified. An invalid event class was specified.
SEE ALSO
Programming With Xlib
XChangeDeviceDontPropagateList(3X11)