Sponsored Content
Operating Systems Solaris Rows to column conversion in Solaris Post 302870925 by omkar.jadhav on Tuesday 5th of November 2013 08:07:53 AM
Old 11-05-2013
Rows to column conversion in Solaris

i am using the command
Code:
pkginfo -l | /usr/xpg4/bin/grep -e 'VENDOR' -e 'NAME' -e 'VERSION' >> /tmp/test1.txt

in order to get name,vendor and version of the applications installed on Solaris machine.The output stored in test1.txt in as shown below:
Code:
      NAME:  Solaris Zones (Usr)
   VERSION:  11.10.0,REV=2005.01.21.16.34
    VENDOR:  Oracle Corporation
      NAME:  Z shell (zsh)
   VERSION:  11.10.0,REV=2005.01.08.01.09
    VENDOR:  Sun Microsystems, Inc.
      NAME:  Symbios 895A, 896 and 1010 SCSI driver
   VERSION:  11.9.0,REV=2005.01.06.07.16
    VENDOR:  LSI Logic Corporation

I want to have 'NAME' 'VERSION' 'VENDOR' as three separate column as below :
NAME:xyz VERSION:1.1 VENDOR:abc

Last edited by joeyg; 11-05-2013 at 09:10 AM.. Reason: Please wrap commands and data in CodeTags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to sum rows in e.g. column 1 by a category in e.g. column 2

Hi, I've shown an example of what I would like to achieve below. In the example file, I would like to sum the values in column 2 for each distinct category in column 3 (presumably making an array?) and print the sum as well as the category name and length (note:length always corresponds with... (8 Replies)
Discussion started by: auburn
8 Replies

2. UNIX for Dummies Questions & Answers

conversion and transpositions of columns and rows

Hi, I am wondering how to do this more efficiently than I am currently doing it: I have these 3 columns 3315 E14 1 397 E14 2 321 E14 3 27 E14 4 7 E14 5 2 E14 6 But I like them to be displayed like this: 1 2 ... (5 Replies)
Discussion started by: danieladna
5 Replies

3. Shell Programming and Scripting

complicated row to rows conversion

I have a file containing rows with the following format. Field1|Field2|Field3|data1:data data2:data data3:"dataA:data dataB:data" data4:data:data (and so on) I need to format the above row into multiple rows that look like this: Field1|Field2|Field3|data1|data ... (2 Replies)
Discussion started by: newreverie
2 Replies

4. Shell Programming and Scripting

awk command to print only selected rows in a particular column specified by column name

Dear All, I have a data file input.csv like below. (Only five column shown here for example.) Data1,StepNo,Data2,Data3,Data4 2,1,3,4,5 3,1,5,6,7 3,2,4,5,6 5,3,5,5,6 From this I want the below output Data1,StepNo,Data2,Data3,Data4 2,1,3,4,5 3,1,5,6,7 where the second column... (4 Replies)
Discussion started by: ks_reddy
4 Replies

5. UNIX for Dummies Questions & Answers

merging rows into new file based on rows and first column

I have 2 files, file01= 7 columns, row unknown (but few) file02= 7 columns, row unknown (but many) now I want to create an output with the first field that is shared in both of them and then subtract the results from the rest of the fields and print there e.g. file 01 James|0|50|25|10|50|30... (1 Reply)
Discussion started by: A-V
1 Replies

6. UNIX for Dummies Questions & Answers

Columns to rows conversion in unix

Hi All, My requirement is to convert the rows to columns, please help me how to do in one command. Ex: source file is having data like ABC,XYZ,123,987,KKK,XXX,666 Need output like ABC XYZ 987 KKK XXX 666 Regards, Pavan. (3 Replies)
Discussion started by: madsongtel
3 Replies

7. UNIX for Dummies Questions & Answers

[Solved] Deleting all rows where the first column equals the second column

Hi, I have a tab delimited text file where the first two columns equal numbers. I want to delete all rows where the value in the first column equals the second column. How do I go about doing that? Thanks! Input: 1 1 ABC DEF 2 2 IJK LMN 1 2 ZYX OPW Output: 1 2 ZYX OPW (2 Replies)
Discussion started by: evelibertine
2 Replies

8. Shell Programming and Scripting

Awk: group rows by id and simple conversion

Hi all, I am a newbie to awk and trying to learn by doing examples. I got stuck at this relatively simple conversion. The start file looks like: 1 2 "t1" 1 3 "h1" 2 1 "h1" 2 2 "h2" and I want to convert it into 1 t1:2, h1:3; 2 h1:1, h2:2; Thanks. (9 Replies)
Discussion started by: eagle_fly
9 Replies

9. Shell Programming and Scripting

Converting Single Column into Multiple rows, but with strings to specific tab column

Dear fellows, I need your help. I'm trying to write a script to convert a single column into multiple rows. But it need to recognize the beginning of the string and set it to its specific Column number. Each Line (loop) begins with digit (RANGE). At this moment it's kind of working, but it... (6 Replies)
Discussion started by: AK47
6 Replies

10. UNIX for Advanced & Expert Users

Conversion of rows to columns using awk based om column value

HI, My Input file data is dn:adcfgeneral id:13343 Name:xxxxxx Password:iutyerwuitywue wpuwt tuiytruityrutyrwtyrwp dn:cdferwjyyyy id:3875 Name:yyyy Password :hgfdsjkfhdsfkdlshf dshfkldshfdklsfh interset:uiuiufj My output should be ... (6 Replies)
Discussion started by: dineshaila
6 Replies
clustertoc(4)															     clustertoc(4)

NAME
clustertoc - cluster table of contents description file The cluster table of contents file, .clustertoc, is an ASCII file that describes a hierarchical view of a software product. A .clustertoc file is required for the base OS product. The file resides in the top-level directory containing the product. The hierarchy described by .clustertoc can be of arbitrary depth, although the initial system installation programs assume that it has three levels. The hierarchy is described bottom-up, with the packages described in .packagetoc at the lowest layer. The next layer is the cluster layer which collects packages into functional units. The highest layer is the meta-cluster layer which collects packages and clus- ters together into typical configurations. The hierarchy exists to facilitate the selection or deselection of software for installation at varying levels of granularity. Interacting at the package level gives the finest level of control over what software is to be installed. Each entry in the .clustertoc file is a line that establishes the value of a parameter in the following form: PARAM=value A line starting with a pound-sign, ``#'', is considered a comment and is ignored. Parameters are grouped by cluster or meta-cluster. The start of a cluster description is defined by a line of the form: CLUSTER=value The start of a meta-cluster description is defined by a line of the form: METACLUSTER=value There is no order implied or assumed for specifying the parameters for a (meta-)cluster with the exception of the CLUSTER or METACLUSTER parameter, which must appear first and the END parameter which must appear last. The following parameters are mandatory: CLUSTER The cluster identifier (for example, SUNWCacc). The identifier specified must be unique within the package and cluster identifier namespace defined by a product's .packagetoc and .clustertoc files. The identifiers used are subject to the same constraints as those for package identifiers. These constraints are (from pkginfo(4)): All characters in the abbreviation must be alphanumeric and the first may not be numeric. The abbreviation is limited to a maximum length of nine characters. install, new, and all are reserved abbreviations. A cluster must be described before another cluster or meta-cluster may refer to it. DESC An informative textual description of the (meta-)cluster's contents. The length of the description supplied may not exceed 256 charac- ters. The text should contain no newlines. METACLUSTER The metacluster identifier (for example, SUNWCprog). The identifier specified must be unique within the package and cluster identifier namespace defined by a product's .packagetoc and .clustertoc files. The identifiers used are subject to the same constraints as those for package identifiers. These constraints are (from pkginfo(4)): All characters in the abbreviation must be alphanumeric and the first may not be numeric. The abbreviation is limited to a maximum length of nine characters. install, new, and all are reserved abbreviations. Meta-clusters can not contain references to other meta-clusters. NAME The full name of the (meta-)cluster. The length of the name string supplied may not exceed 256 characters. SUNW_CSRMEMBER Indicates that the package or cluster is a part of the (meta-) cluster currently being described. The value specified is the identifier of the package or cluster. There may be an arbitrary number of SUNW_CSRMEMBER parameters per (meta-)cluster. VENDOR The name of the (meta-)cluster's vendor. The length of the vendor string supplied may not exceed 256 characters. VERSION The version of the (meta-)cluster. The length of the version string supplied may not exceed 256 characters. The following parameters are optional: DEFAULT Specifies which metacluster within a .clustertoc file should be selected or installed by default. Only one metacluster can be the default. HIDDEN Specifies whether a metacluster should be hidden by applications. A hidden metacluster cannot be DEFAULT. REQUIRED Specifies which metacluster is required. A required metacluster implies that all of its cluster and package members are not de- selectable (must be installed). SUNW_CSRMBRIFF Indicates that the package is to be included dynamically in the (meta-)cluster currently being described. The value of this parameter must follow the following format: SUNW_CSRMBRIFF=(test test_arc)package This line is converted into a SUNW_CSRMEMBER entry at media installation time if the test provided matches the platform on which the media is being installed. There may be zero or more SUNW_CSRMBRIFF parameters per (meta-)cluster. SUNW_CSRMBRIFF=(test value)package where the test is either the builtin test of "platform" or a shell script which returns shell true(0) or shell false(1) depending on the tests being performed in the script. value is passed to the test as the first argument and can be used to create a script that tests for multiple hardware objects. Finally package is the package that is included in the final .clustertoc file as a SUNW_CSRMEMBER. See parse_dynamic_clustertoc(1M) for more information about the scripts. Example 1: A Cluster Description The following is an example of a cluster description in a .clustertoc file. CLUSTER=SUNWCacc NAME=System Accounting DESC=System accounting utilities VENDOR=Sun Microsystems, Inc. VERSION=7.2 SUNW_CSRMEMBER=SUNWaccr SUNW_CSRMEMBER=SUNWaccu END Example 2: A Meta-cluster Description The following is an example of a meta-cluster description in a .clustertoc file. METACLUSTER=SUNWCreq NAME=Core System Support DESC=A pre-defined software configuration consisting of the minimum required software for a standalone, non-networked workstation. VENDOR=Sun Microsystems, Inc. VERSION=2.x SUNW_CSRMEMBER=SUNWadmr SUNW_CSRMEMBER=SUNWcar SUNW_CSRMEMBER=SUNWCcs SUNW_CSRMEMBER=SUNWCcg6 SUNW_CSRMEMBER=SUNWCdfb SUNW_CSRMEMBER=SUNWkvm SUNW_CSRMEMBER=SUNWCnis SUNW_CSRMEMBER=SUNWowdv SUNW_CSRMEMBER=SUNWter END Example 3: A Meta-cluster Description With a Dynamic Cluster Entry The following is an example of a meta-cluster description with a dynamic cluster entry as indicated by the use of the SUNW_CSRMBRIFF param- eter entries. METACLUSTER=SUNWCprog NAME=Developer System Support DESC=A pre-defined software configuration consisting of the typical software used by software developers. VENDOR=Sun Microsystems, Inc. VERSION=2.5 SUNW_CSRMEMBER=SUNWCadm SUNW_CSRMBRIFF=(smcc.dctoc tcx)SUNWCtcx SUNW_CSRMBRIFF=(smcc.dctoc leo)SUNWCleo SUNW_CSRMBRIFF=(smcc.dctoc sx)SUNWCsx ... END parse_dynamic_clustertoc(1M), cdtoc(4), order(4), packagetoc(4), pkginfo(4) The current implementation of the initial system installation programs depend on the .clustertoc describing three required meta-clusters for the base OS product: SUNWCall Contains all of the software packages in the OS distribution. SUNWCuser Contains the typical software packages for an end-user of the OS distribution. SUNWCreq Contains the bare-minimum packages required to boot and configure the OS to the point of running a multi-user shell. 18 Feb 2003 clustertoc(4)
All times are GMT -4. The time now is 11:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy