Hi,
I want to write a shell script which increments a particular column in a row from a text file and then adds another row below the current row with the incremented value .
For Eg .
if the input file has a row :
abc xyz lmn 89 lm nk o p
I would like the script to create something like... (9 Replies)
Hi All,
I would like to have a script which is able to perform the below.
Print the whole row if column1 which is "0001" for the below example is the first occurrence. Subsequent "0001" occurrence will not be printed out and so on.
Can any expert help ?
Input:
0001 k= 40
0001 k= 2... (7 Replies)
I want to check if every <Part> element has corresponding <Description> in this sample XML.
....<Lot Of XML>
<Inv lineNumber="2">
<Item>
... (4 Replies)
Hi Friends,
I have a single column data like below.
1
2
3
4
5
I need the output like below.
0
1
2
3
4
where each row (including first row) subtracting from first row and the result should print below like the way shown in output file.
Thanks
Sid (11 Replies)
Hi.
How can we print those rows of file2 which are mentioned in file1. first character of file1 is a row number.. for eg
file1
1:abc
3:ghi
6:pqr
file2
a abc
b def
c ghi
d jkl
e mno
f pqr
... (6 Replies)
I have a table with this structure:
cola colb colc
1 19 lemon
20 31 lemon
32 100 lemon
159 205 cherries
210 500 cherries
and need to parse it into this format:
cola colb colc
1 100 lemon
159 500 cherries
So I need the first row of cola and the last row of colb if colc has the... (3 Replies)
Hello,
I have this table:
chr1_16857_17742 - chr1 17369 17436 "ENST00000619216.1"; "MIR6859-1"; - 67
chr1_16857_17742 - chr1 14404 29570 "ENST00000488147.1"; "WASH7P"; - 885
chr1_16857_18061 - chr1 ... (5 Replies)
Discussion started by: coppuca
5 Replies
LEARN ABOUT OPENSOLARIS
timeradd
timeradd(3C) Standard C Library Functions timeradd(3C)NAME
timeradd, timersub, timerclear, timerisset, timercmp - operations on timeval structures
SYNOPSIS
#include <sys/time.h>
void timeradd(struct timeval *a, struct timeval *b,
struct timeval *res);
void timerclear(struct timeval *tvp);
int timercmp(struct timeval *a, struct timeval *b, CMP);
int timerisset(struct timeval *tvp);
void timersub(struct timeval *a, struct timeval *b,
struct timeval *res);
DESCRIPTION
These macros are provided for manipulating timeval structures for use with gettimeofday(3C) and settimeofday(3C) operands. The structure is
defined in <sys/time.h> as:
struct timeval {
long tv_sec; /* seconds since Jan. 1, 1970 */
long tv_usec; /* and microseconds */
};
The timeradd() macro adds the time information stored in a to b and stores the resulting timeval in res. The results are simplified such
that the value of res->tv_usec is always less than 1,000,000 (1 second).
The timersub() macro subtracts the time information stored in b from a and stores the resulting timeval in res.
The timerclear() macro initializes tvp to midnight (0 hour) January 1st, 1970 (the Epoch).
The timerisset() macro returns true if tvp is set to any time value other than the Epoch.
The timercmp() macro compares a to b using the form a CMP b, where CMP is one of <, <=, ==, !=, >=, or >.
USAGE
These macros are not available in function form. All of these macros evaluate their arguments more than once. If parameters passed to these
macros are expressions with side effects, the results are undefined.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe with Exceptions |
+-----------------------------+-----------------------------+
SEE ALSO gettimeofday(3C), attributes(5)SunOS 5.11 12 Jun 2008 timeradd(3C)