Sponsored Content
Full Discussion: Need comma separated output
Top Forums Shell Programming and Scripting Need comma separated output Post 302848607 by RudiC on Thursday 29th of August 2013 03:43:38 PM
Old 08-29-2013
Easy with awk:
Code:
awk     '$1 ~ /Server/  {printf "\n"; printf "%s,", $1; SL=""; next}
                        {printf "%s%s", SL, $1; SL="/"}
         END            {printf "\n"}
        ' file
Server1,oracle
Server2,http/webadmin/oracle
Server3,tsm/webadm

This User Gave Thanks to RudiC For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need comma separated processing

I have a file like this OUTLN OPEN Y SCOTT OPEN N USER4 OPEN Y DBSNMP EXPIRED & LOCKED N ... (4 Replies)
Discussion started by: ilugopal
4 Replies

2. Shell Programming and Scripting

Perl script to parse output and print it comma separated

I need to arrange output of SQL query into a comma separated format and I'm struggling with processing the output... The output is something like this: <Attribute1 name><x amount of white spaces><Atribute value> <Attribute2 name><x amount of white spaces><Atribute value> <Attribute3... (2 Replies)
Discussion started by: Juha
2 Replies

3. Shell Programming and Scripting

Output of command in comma separated list

Hi; I have an output of a particular command say $command fstl:r-x ajay:r-x how can i get this in comma separated list, eg: fstl:r-x,ajay:r-x Thnks; (4 Replies)
Discussion started by: ajaypadvi
4 Replies

4. Shell Programming and Scripting

Comma separated file

Hi all, I have the following files types: FileA: 100, 23, 33, FileB: 22, 45, 78, and i want to make File C: 100,22 23,45 33,78 any nice suggestions for making it easy. (3 Replies)
Discussion started by: hen1610
3 Replies

5. Shell Programming and Scripting

Need Help - comma inside double quote in comma separated csv,

Hello there, I have a comma separated csv , and all the text field is wrapped by double quote. Issue is some text field contain comma as well inside double quote. so it is difficult to process. Input in the csv file is , 1,234,"abc,12,gh","GH234TY",34 I need output like below,... (8 Replies)
Discussion started by: Uttam Maji
8 Replies

6. Shell Programming and Scripting

How to split the comma separated file?

Hi, I have a filein unix like ABC,CDE BCD,KHL and the output i need is like column1 column2 ABC,CDE ABC ABC,CDE CDE BCD,KHL BCD BCD,KHL KHL. Can some body help me out? Hi, The code is working fine. But in my file each row does not have always 1 comma. It may... (6 Replies)
Discussion started by: jagdishrout
6 Replies

7. UNIX for Dummies Questions & Answers

[solved] Comma separated values to space separated

Hi, I have a large number of files which are written as csv (comma-separated values). Does anyone know of simple sed/awk command do achieve this? Thanks! ---------- Post updated at 10:59 AM ---------- Previous update was at 10:54 AM ---------- Guess I asked this too soon. Found the... (0 Replies)
Discussion started by: lost.identity
0 Replies

8. Shell Programming and Scripting

awk to parse comma separated field and removing comma in between number and double quotes

Hi Experts, Please support I have below data in file in comma seperated, but 4th column is containing comma in between numbers, bcz of which when i tried to parse the file the column 6th value(5049641141) is being removed from the file and value(222.82) in column 5 becoming value of column6. ... (3 Replies)
Discussion started by: as7951
3 Replies

9. UNIX for Beginners Questions & Answers

How to extract fields from a CSV i.e comma separated where some of the fields having comma as value?

can anyone help me!!!! How to I parse the CSV file file name : abc.csv (csv file) The above file containing data like abv,sfs,,hju,',',jkk wff,fst,,rgr,',',rgr ere,edf,erg,',',rgr,rgr I have a requirement like i have to extract different field and assign them into different... (4 Replies)
Discussion started by: J.Jena
4 Replies
Ipmidetect(8)							    Ipmidetect							     Ipmidetect(8)

NAME
ipmidetect - list detected and/or undetected IPMI interfaces in a cluster SYNOPSIS
ipmidetect [OPTION...] [NODES...] DESCRIPTION
ipmidetect lists which IPMI nodes have been detected or undetected in a cluster. This information is provided by the libipmidetect(3) library and ipmidetectd(8) daemon. ipmidetect will output the status of each IPMI node configured with ipmidetectd(8) unless they are specified on the command line. If the first node listed is "-", nodes will be read in from standard input. The nodes can be listed in hostrange format, comma separated lists, or space separated lists. See the section below on HOSTRANGED SUPPORT for instructions on how to list hosts in range format. The hostnames listed must be the shortened names of hostnames. OPTIONS
-h, --help Print help and exit -v, --version Print version and exit -o STRING, --hostname=STRING server hostname (default=localhost) -p INT, --port=INT server port (default=8649) -d, --detected List only detected nodes -u, --undetected List only undetected nodes -q, --hostrange List nodes in hostrange format (default) -c, --comma List nodes in comma separated list -n, --newline List nodes in newline separated list -s, --space List nodes in space separated list HOSTRANGED SUPPORT
Multiple hosts can be input either as an explicit comma separated lists of hosts or a range of hostnames in the general form: prefix[n-m,l- k,...], where n < m and l < k, etc. The later form should not be confused with regular expression character classes (also denoted by []). For example, foo[19] does not represent foo1 or foo9, but rather represents a degenerate range: foo19. This range syntax is meant only as a convenience on clusters with a prefixNN naming convention and specification of ranges should not be considered necessary -- the list foo1,foo9 could be specified as such, or by the range foo[1,9]. Some examples of range usage follow: foo[01-05] instead of foo01,foo02,foo03,foo04,foo05 foo[7,9-10] instead of foo7,foo9,foo10 foo[0-3] instead of foo0,foo1,foo2,foo3 As a reminder to the reader, some shells will interpret brackets ([ and ]) for pattern matching. Depending on your shell, it may be neces- sary to enclose ranged lists within quotes. REPORTING BUGS
Report bugs to <freeipmi-users@gnu.org> or <freeipmi-devel@gnu.org>. COPYRIGHT
Copyright (C) 2007-2012 Lawrence Livermore National Security, LLC. Copyright (C) 2007 The Regents of the University of California. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. SEE ALSO
libipmidetect(3), ipmidetect.conf(5), ipmidetectd(8) http://www.gnu.org/software/freeipmi/ Ipmidetect 1.1.5 2012-06-15 Ipmidetect(8)
All times are GMT -4. The time now is 06:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy