HI guys,
I have created a script to read 1 column in a csv file and then place it in text file.
However, when i checked out the text file, it is not in a column format...
Example:
CSV file contains
name,age
aa,11
bb,22
cc,33
After using awk to get first column
TXT file... (1 Reply)
I am sending the output of a file to .csv file.
The output should look like this:
Total Customers Processed:,8
Total Customers Skipped:,0
Total Customers Added:,8
Total Customers Changed:,0
Total Policies Deleted:,0
Total Policies Failed:,0
total:,8
Now i want this output in... (1 Reply)
Hi All,
I have created a Unix Shell script whch creates a *.csv file and export it to Excel.
The problem i am facing is that Users wants one of the AMOUNT field in comma separted values. Example :
if the Amount has the value as 3000000 User wants to be in 3,000,000 format.
This Amount format... (2 Replies)
I am getting a no of fields from a SQL session (e.g. select a,b,c from table). How do I convert the output values into CSV format .
The output should be like this 'a','b','c', (4 Replies)
Hi team,
In simple way i will explain.. i have a shell script which gives morethan one output
echo"some code" ----> it gives one output
echo"some code" ----> it gives one output
echo"some code" ----> it gives one output
echo"some code" ----> it gives one output
i want all this to put... (0 Replies)
Hi Friends,
I'm a great fan of this forum... it has helped me tone my skills in shell scripting. I have a challenge here, which I'm sure you guys would help me in achieving...
File A has a list of job ids and I need to compare this with the File B (*.log) and File C (extend *.log) and copy... (6 Replies)
Hi All,
I get the test result file daily after running the main test script. from the resultfile, need to fetch only server info and status and put them in tabular format in a file and as well in CSV format output file.
I tried using awk command but am not able to put them in tabluar... (6 Replies)
I'm just wondering is there any way to capture the output of a unix command in a csv format.
df -h gives the result of filesystem,free space,Used space, use %,mounted on.
Is there a way to capture the command output and format it as comma sparated or fixed length file. (3 Replies)
My source file looks like this:
Cust-Number = "101"
Cust-Name="Joe"
Cust-Town="London"
Cust-hobby="tennis"
Cust-purchase="200"
Cust-Number = "102"
Cust-Name="Mary"
Cust-Town="Newyork"
Cust-hobby="reading"
Cust-purchase="125"
Now I want to parse this file (leaving out hobby) and... (10 Replies)
Hi Experts,
I am writing a python script to grep string from file and display output in csv file as in attached screenshot
https://drive.google.com/file/d/1gfUUdfmQma33tz65NskThYDhkZUGQO0H/view
Input file(result_EPFT_config_device)
Below is the python script i have prepared as of... (1 Reply)
Discussion started by: as7951
1 Replies
LEARN ABOUT SUNOS
wsreg_get_instance
wsreg_set_instance(3WSREG) Product Install Registry Library Functions wsreg_set_instance(3WSREG)NAME
wsreg_set_instance, wsreg_get_instance - set or get the instance of a component
SYNOPSIS
cc [flag ...] file ...-lwsreg [library ...]
#include <wsreg.h>
int wsreg_set_instance(Wsreg_component *comp, int instance);
int wsreg_get_instance(Wsreg_component *comp);
DESCRIPTION
The wsreg_set_instance() function sets the instance number specified by instance of the component specified by comp. The instance number
and uuid are used to uniquely identify any component in the product install registry.
The wsreg_get_instance() function determines the instance number associated with the component specified by comp.
RETURN VALUES
The wsreg_set_instance() function returns a non-zero value if the instance was set correctly; otherwise 0 is returned.
The wsreg_get_instance() function returns the instance number associated with the specified component.
EXAMPLES
Example 1: Get the instance value of a registered component.
The following example demonstrates how how to get the instance value of a registered component.
#include <fcntl.h>
#include <wsreg.h>
int main (int argc, char **argv)
{
char *uuid = "d6cf2869-1dd1-11b2-9fcb-080020b69971";
Wsreg_component *comp = NULL;
/* Initialize the registry */
wsreg_initialize(WSREG_INIT_NORMAL, NULL);
if (!wsreg_can_access_registry(O_RDWR)) {
printf("No permission to modify the registry.
");
return 1;
}
/* Create a component */
comp = wsreg_create_component(uuid);
wsreg_set_unique_name(comp, "wsreg_example_1");
wsreg_set_version(comp, "1.0");
wsreg_add_display_name(comp, "en", "Example 1 component");
wsreg_set_type(comp, WSREG_COMPONENT);
wsreg_set_location(comp, "/usr/local/example1_component");
/* Register */
wsreg_register(comp);
printf("Instance %d was assigned
", wsreg_get_instance(comp));
wsreg_free_component(comp);
return 0;
}
USAGE
Upon component registration with the wsreg_register(3WSREG) function, the instance number is set automatically. The instance number of 0
(the default) indicates to the wsreg_register() function that an instance number should be looked up and assigned during registration. If
a component with the same uuid and location is already registered in the product install registry, that component's instance number will be
used during registration.
After registration of a component, the wsreg_get_instance() function can be used to determine what instance value was assigned.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT-Level |Unsafe |
+-----------------------------+-----------------------------+
SEE ALSO wsreg_create_component(3WSREG), wsreg_register(3WSREG), attributes(5)SunOS 5.10 22 Sep 2000 wsreg_set_instance(3WSREG)