I have a requirement in which i have to read a file which has multiple columns seperated by a pipe "|" from this i have to read each column values seperately and create a comma seperated row for the column and write to another file.
eg:
Input file:
ColA ColB
1 2
2 x
3 y... (5 Replies)
Hi All,
I have a file which is having 3 columns as (string string integer)
a b 1
x y 2
p k 5
y y 4
.....
.....
Question:
I want get the unique value of column 2 in a sorted way(on column 2) and the sum of the 3rd column of the corresponding rows. e.g the above file should return the... (6 Replies)
I am a newbie to shell scripting ..
I have a .csv file. It has 1000 some rows and about 7 columns...
but before I insert this data to a table I have to parse it and clean it ..basing on the value of the first column..which a string of phone number type...
example below..
column 1 ... (2 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 would like to ask you guys any advise regarding my problem
I have this kind of data
file.txt
111111111,20
111111111,50
222222222,70
333333333,40
444444444,10
444444444,20
I need to get this
file1.txt
111111111,70
222222222,70
333333333,40
444444444,30
using this code I can... (6 Replies)
Hi,
I have multiple files that each contain four columns of strings:
File1:
Code:
123 abc gfh 273
456 ddff jfh 837
789 ghi u4u 395
File2:
Code:
123 abc dd fu
456 def 457 nd
891 384 djh 783
I want to compare the strings in Column 1 of File 1 with each other file and Print in... (3 Replies)
I want to bring values in the second column into single line for uniq value in the first column.
My input
jvm01, Web 2.0 Feature Pack Library
jvm01, IBM WebSphere JAX-RS
jvm01, Custom01 Shared Library
jvm02, Web 2.0 Feature Pack Library
jvm02, IBM WebSphere JAX-RS
jvm03, Web 2.0 Feature... (10 Replies)
Hi All,
Does anyone have any suggestions/examples of how i could show only lines where the first field is not duplicated. If the first field is listed more than once it shouldnt be shown even if the other columns make it unique.
Example file :
876,RIBDA,EC2
876,RIBDH,EX7
877,RIBDF,E28... (4 Replies)
Discussion started by: mutley2202
4 Replies
LEARN ABOUT SUNOS
sysevent_post_event
sysevent_post_event(3SYSEVENT) System Event Library Functions sysevent_post_event(3SYSEVENT)NAME
sysevent_post_event - post system event for applications
SYNOPSIS
cc [ flag... ] file... -lsysevent -lnvpair [ library... ]
#include <libsysevent.h>
#include <libnvpair.h>
int sysevent_post_event(char *class, char *subclass, char *vendor, char *publisher, nvlist_t *attr_list, sysevent_id_t *eid);
PARAMETERS
attr_list pointer to an nvlist_t, listing the name-value attributes associated with the event, or NULL if there are no such
attributes for this event
class pointer to a string defining the event class
eid pointer to a system unique identifier
publisher pointer to a string defining the event's publisher nam
subclass pointer to a string defining the event subclass
vendor pointer to a string defining the vendor
DESCRIPTION
The sysevent_post_event() function causes a system event of the specified class, subclass, vendor, and publisher to be generated on behalf
of the caller and queued for delivery to the sysevent daemon syseventd(1M).
The vendor should be the company stock symbol (or similarly enduring identifier) of the event posting application. The publisher should be
the name of the application generating the event.
For example, all events posted by Sun applications begin with the company's stock symbol, "SUNW". The publisher is usually the name of the
application generating the system event. A system event generated by devfsadm(1M) has a publisher string of devfsadm.
The publisher information is used by sysevent consumers to filter unwanted event publishers.
Upon successful queuing of the system event, a unique identifier is assigned to eid.
RETURN VALUES
The sysevent_post_event() function returns 0 if the system event has been queued successfully for delivery. Otherwise it returns -1 and
sets errno to indicate the error.
ERRORS
The sysevent_post_event() function will fail if:
ENOMEM Insufficient resources to queue the system event.
EIO The syseventd daemon is not responding and events cannot be queued or delivered at this time.
EINVAL Invalid argument.
EPERM Permission denied.
EFAULT A copy error occurred.
EXAMPLES
Example 1: Post a system event event with no attributes.
The following example posts a system event event with no attributes.
if (sysevent_post_event(EC_PRIV, "ESC_MYSUBCLASS", "SUNW", argv[0],
NULL), &eid == -1) {
fprintf(stderr, "error logging system event
");
}
Example 2: Post a system event with two name-value pair attributes.
The following example posts a system event event with two name-value pair attributes, an integer value and a string.
nvlist_t *attr_list;
uint32_t uint32_val = 0XFFFFFFFF;
char *string_val = "string value data";
if (nvlist_alloc(&attr_list, 0, 0) == 0) {
err = nvlist_add_uint32(attr_list, "uint32 data", uint32_val);
if (err == 0)
err = nvlist_add_string(attr_list, "str data",
string_val);
if (err == 0)
err = sysevent_post_event(EC_PRIV, "ESC_MYSUBCLASS",
"SUNW", argv[0], attr_list, &eid);
if (err != 0)
fprintf(stderr, "error logging system event
");
nvlist_free(attr_list);
}
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO devfsadm(1M), syseventd(1M), nvlist_add_boolean(3NVPAIR), nvlist_alloc(3NVPAIR), attributes(5)SunOS 5.10 26 May 2004 sysevent_post_event(3SYSEVENT)