Sponsored Content
Full Discussion: Logic needed
Top Forums Shell Programming and Scripting Logic needed Post 302647945 by HemaV on Tuesday 29th of May 2012 06:09:04 AM
Old 05-29-2012
Logic needed

input :
Code:
employee_id, salary
-------------------
10,          1000
20,          2000
30,          3000
40,          5000


output:
Code:
employee_id, salary, next_row_salary
------------------------------------
10,          1000,       2000
20,          2000,       3000
30,          3000,       5000
40,          5000,       Null

Please gimme the command to get this output

Last edited by Franklin52; 05-29-2012 at 07:09 AM.. Reason: Please use code tags
 

2 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

logic needed to extract lines

Hi All, Are there any logic to extract the only lines between first two *TM* (which is marked in blue)? VOL1HST99 0 HDR1A999999S 999999HST99 HDR2F001200012001 UHL1 0729609000001 000000 *TM*^^^^^^^^^^^^^^^^^^^^^^ 01012610252171017301805000... (2 Replies)
Discussion started by: ganapati
2 Replies

2. Shell Programming and Scripting

Logic needed to recursive looping in the script

Hello i have a requirement where in a file i will get string. The length could be from 1 to 20. if the string is less than 6 characters ( ex: ABCD) . i need to append 'X' on right hand side to make it 6 characters (ex: ABCDXX). if suppose i get the same string from the file as ABCDXX then i... (5 Replies)
Discussion started by: dsdev_123
5 Replies
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)
All times are GMT -4. The time now is 10:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy