Sponsored Content
Top Forums Shell Programming and Scripting change output format using ksh Post 302527492 by oldman2 on Friday 3rd of June 2011 11:54:59 AM
Old 06-03-2011
change output format using ksh

I have a script that reaches out to several systems and pulls back infomation in serveral files. I would like to take the infomation returned and reformat it so I can export it to excel.

Below is current output:
Code:
File1:item1:abc=1
File1:item2:efg
File2:item1:ab=1
File2:item2:efg
File2:item3:hij

I would like to reformat it to the following:
Code:
,File1,File2
item1,abc=1,ab=1
item2,efg,efg
item3,,hij

Any one have an easy way of doing that?
Moderator's Comments:
Mod Comment
Please use code tags when posting data and code samples!

Last edited by vgersh99; 06-03-2011 at 02:06 PM.. Reason: code tags, please!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

change the empty function from the old format to the new format

I have about 300 files which has the function getDBBackend(). How to write a program to change the empty function from the old format to the new format? Old empty function format are either: function getDBBackend() { // Not available } // getDBBackend or: function... (0 Replies)
Discussion started by: powah
0 Replies

2. Shell Programming and Scripting

format decimal in ksh

hi all, in ksh, how do i format a decimal number (e.g 3381.19) to integer (e.g 3381). This number is average time response for server in millisec and i wanted to display it in a more readable format i.e in seconds without any decimals. thanks in advance. (2 Replies)
Discussion started by: cesarNZ
2 Replies

3. Shell Programming and Scripting

capturing output from top and format output

Hi all, I'd like to capture the output from the 'top' command to monitor my CPU and Mem utilisation.Currently my command isecho date `top -b -n1 | grep -e Cpu -e Mem` I get the output in 3 separate lines.Tue Feb 24 15:00:03 Cpu(s): 3.4% us, 8.5% sy .. .. Mem: 1011480k total, 226928k used, ....... (4 Replies)
Discussion started by: new2ss
4 Replies

4. Shell Programming and Scripting

Change file output format

I have a file which has following contents usmtnz-dinfsi19 62 61 18400 18800 99.7 usmtnz-dinfsi19 62 61 18400 18800 99.7 i want the o/p to be like date (7 Replies)
Discussion started by: fugitive
7 Replies

5. Shell Programming and Scripting

KSH script to run other ksh scripts and output it to a file and/or email

Hi I am new to this Scripting process and would like to know How can i write a ksh script that will call other ksh scripts and write the output to a file and/or email. For example ------- Script ABC ------- a.ksh b.ksh c.ksh I need to call all three scripts execute them and... (2 Replies)
Discussion started by: pacifican
2 Replies

6. Shell Programming and Scripting

change the output format

when i run the following command db2 list tablespaces Tablespaces for Current Database Tablespace ID = 0 Name = SYSCATSPACE State = 0x0000 Tablespace ID ... (3 Replies)
Discussion started by: lazydev
3 Replies

7. Shell Programming and Scripting

How can I change is output format by awk ?

Hello, Can you tell me how can I change this format by awk Input 0.2057422D-01 0.2463722D-01 -0.1068047D-02 Output 0.02057422 0.02463722 -0.001068047 Thanks wan (8 Replies)
Discussion started by: wanchem
8 Replies

8. Shell Programming and Scripting

How to format String in ksh

Hi, I have 3 columns to display to target file and the display of the columns with specified position in target file. I have tried with printf command The Columns position like: Column1= 0 to 30 Column2=30 to 60 Column3=60 to 90 The source data: EMPNO,ENAME,SAL 1,11,100 2,22,200... (4 Replies)
Discussion started by: koti_rama
4 Replies

9. Shell Programming and Scripting

Change name format

I am trying to use either awk or sed to make names like J. A. Smith and J.A. Martin Smith become JA Smith and JA Martin SmithThe code should concatenate abbreviated letters that have a dot after them. I have only been able to do this: echo $name | sed 's/\.\ //g'But that concatenates the... (3 Replies)
Discussion started by: locoroco
3 Replies

10. Shell Programming and Scripting

Script to generate Excel file or to SQL output data to Excel format/tabular format

Hi , i am generating some data by firing sql query with connecting to the database by my solaris box. The below one should be the header line of my excel ,here its coming in separate row. TO_CHAR(C. CURR_EMP_NO ---------- --------------- LST_NM... (6 Replies)
Discussion started by: dani1234
6 Replies
widget_toolbar(3tk)					    widget::toolbar Megawidget					       widget_toolbar(3tk)

__________________________________________________________________________________________________________________________________________________

NAME
widget_toolbar - widget::toolbar Megawidget SYNOPSIS
package require Tcl 8.4 package require Tk 8.4 package require widget ?3.0? package require widget::toolbar ?1.0? widget::toolbar pathname ?options? getframe add ?item? ?args? delete item1 ?item2? ?...? itemcget symbol option itemconfigure symbol ?args? items ?pattern? remove ?-destroy? item1 ?item2? ?...? _________________________________________________________________ DESCRIPTION
This package provides a toolbar megawidget (snidget). It makes use of the Tile/Ttk themed widget set. widget::toolbar pathname ?options? getframe add ?item? ?args? delete item1 ?item2? ?...? itemcget symbol option itemconfigure symbol ?args? items ?pattern? remove ?-destroy? item1 ?item2? ?...? WIDGET OPTIONS
-ipad -pad -separator ITEM OPTIONS
-pad -separator -sticky -weight EXAMPLE
package require widget::toolbar ; # or widget::all set t [widget::toolbar .t] pack $t -fill x -expand 1 $t add button [button .b -text foo] $t add separator -pad {2 4} $t add button [button .c -text bar] KEYWORDS
megawidget, snit, widget widget 3.0 widget_toolbar(3tk)
All times are GMT -4. The time now is 10:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy