Hello Seniors!!! I am trying to add to lines on a file which is delimited by character "|".
input.txt
Desired Output file should give simple addition.
output.txt
Can some one provide me simple awk solution to this. M struggling to solve this using awk & for loop inside awk.
Thanks... (2 Replies)
Hi all,
I am getting following output by using commands like sort, uniq and awk to the standard output.
110 d
40 a
59 c
9 b
3 e
Now at the end I would like to add all the numbers in column 1 and display the count of all numbers i.e. (110 + 40 + 59 + 9 + 3).
Also the output may... (3 Replies)
Hi all,
I am very new to shell programming and trying to learn out the basics.
I tried this:
$ echo `expr 20 + 30`
and it worked. But when i tried this,it does not work.
$ a=20
$ b=30
$ echo `expr a + b`
The error is:
expr: non-numeric argument
I cant understand why its... (3 Replies)
Hi,
I want to add 3 new fields in the existing file.Please find the example below.
input:
UID: ABCD
UNAME: XYZ
Desired Output
Tmiestamp: 20101208
UID: ABCD
UNAME: XYZ
DEPTNO:40
ModifyTImestamp:20101209
If you see the above i have added the 3 columns manually in the output section... (2 Replies)
Hi
when we diff of 2 files then output is showing lines which are different and then we have to manually find which word is different
diff file1 file2
is there any way to show or highlight ONLY the words which are different via diff or some other command ?
Thanks
rel (1 Reply)
a=10.00
pattern=-11.00
b=`echo "$a $pattern" | awk ' printf("%d\n", $1 + $2)'`
echo $b
not working, also trined bc ,dc but thats not on my m/c.
also expr not supporting.
any clue? (6 Replies)
QUESTION1:
How do you grep only an exact string. I am using Solaris10 and do not have any GNU products installed.
Contents of car.txt
CAR1_KEY0
CAR1_KEY1
CAR2_KEY0
CAR2_KEY1
CAR1_KEY10
CURRENT COMMAND LINE: WHERE VARIABLE CAR_NUMBER=1 AND KEY_NUMBER=1
grep... (1 Reply)
Hello all
I have a statement :
ARRAY_MOUNT_POINT_NAME=`df -h | awk '{print $6}'| head -`expr $i+2` |tail -1`
when the value of i=0 , I want the head argument to be at -2 . Using the expr statement isnt working.
Help ! (5 Replies)
Im stumped on this one. Id like to echo into a .txt file all names for an xml feed in a huge folder. Can that be done?? Id need to echo <name>This name</name> in client.xml files.
$path="/mnt/windows/path"
echo 'recording names'
cd "$path"
for names in $path
than Im stuck on... (2 Replies)
Discussion started by: graphicsman
2 Replies
LEARN ABOUT PHP
fixadd
fixadd(3alleg4) Allegro manual fixadd(3alleg4)NAME
fixadd - Safe function to add fixed point numbers clamping overflow. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
fixed fixadd(fixed x, fixed y);
DESCRIPTION
Although fixed point numbers can be added with the normal '+' integer operator, that doesn't provide any protection against overflow. If
overflow is a problem, you should use this function instead. It is slower than using integer operators, but if an overflow occurs it will
set `errno' and clamp the result, rather than just letting it wrap. Example:
fixed result;
/* This will put 5035 into `result'. */
result = fixadd(itofix(5000), itofix(35));
/* Sets `errno' and puts -32768 into `result'. */
result = fixadd(itofix(-31000), itofix(-3000));
ASSERT(!errno); /* This will fail. */
RETURN VALUE
Returns the clamped result of adding `x' to `y', setting `errno' to ERANGE if there was an overflow.
SEE ALSO fixsub(3alleg4), fixmul(3alleg4), fixdiv(3alleg4)Allegro version 4.4.2 fixadd(3alleg4)