Sponsored Content
Top Forums Shell Programming and Scripting Convert rows into column along with header Post 302996837 by john_prince on Wednesday 3rd of May 2017 08:23:44 AM
Old 05-03-2017
Hi Rudic,

This looks excellent.

I have two minor changes.

1. I need to print header only once.
2. Also, there should be a new first column "Timestamp" where timestamp value will be place like this "*Wed Dec 16 10:33:30 GMT 2015" , I mean no zzz *** only timestamp.

Here is the sample format :

Code:
Timestamp vda-rrqm/s vda-wrqm/s vda-r/s vda-w/s vda-rkB/s vda-wkB/s vda-avgrq-sz vda-avgqu-sz vda-await vda-r_await vda-w_await vda-svctm vda-%util vdb-rrqm/s vdb-wrqm/s vdb-r/s vdb-w/s vdb-rkB/s vdb-wkB/s vdb-avgrq-sz vdb-avgqu-sz vdb-await vdb-r_await vdb-w_await vdb-svctm vdb-%util vdc-rrqm/s vdc-wrqm/s vdc-r/s vdc-w/s vdc-rkB/s vdc-wkB/s vdc-avgrq-sz vdc-avgqu-sz vdc-await vdc-r_await vdc-w_await vdc-svctm vdc-%util vdd-rrqm/s vdd-wrqm/s vdd-r/s vdd-w/s vdd-rkB/s vdd-wkB/s vdd-avgrq-sz vdd-avgqu-sz vdd-await vdd-r_await vdd-w_await vdd-svctm vdd-%util vde-rrqm/s vde-wrqm/s vde-r/s vde-w/s vde-rkB/s vde-wkB/s vde-avgrq-sz vde-avgqu-sz vde-await vde-r_await vde-w_await vde-svctm vde-%util vdf-rrqm/s vdf-wrqm/s vdf-r/s vdf-w/s vdf-rkB/s vdf-wkB/s vdf-avgrq-sz vdf-avgqu-sz vdf-await vdf-r_await vdf-w_await vdf-svctm vdf-%util vdg-rrqm/s vdg-wrqm/s vdg-r/s vdg-w/s vdg-rkB/s vdg-wkB/s vdg-avgrq-sz vdg-avgqu-sz vdg-await vdg-r_await vdg-w_await vdg-svctm vdg-%util vdh-rrqm/s vdh-wrqm/s vdh-r/s vdh-w/s vdh-rkB/s vdh-wkB/s vdh-avgrq-sz vdh-avgqu-sz vdh-await vdh-r_await vdh-w_await vdh-svctm vdh-%util dm-0-rrqm/s dm-0-wrqm/s dm-0-r/s dm-0-w/s dm-0-rkB/s dm-0-wkB/s dm-0-avgrq-sz dm-0-avgqu-sz dm-0-await dm-0-r_await dm-0-w_await dm-0-svctm dm-0-%util dm-1-rrqm/s dm-1-wrqm/s dm-1-r/s dm-1-w/s dm-1-rkB/s dm-1-wkB/s dm-1-avgrq-sz dm-1-avgqu-sz dm-1-await dm-1-r_await dm-1-w_await dm-1-svctm dm-1-%util dm-2-rrqm/s dm-2-wrqm/s dm-2-r/s dm-2-w/s dm-2-rkB/s dm-2-wkB/s dm-2-avgrq-sz dm-2-avgqu-sz dm-2-await dm-2-r_await dm-2-w_await dm-2-svctm dm-2-%util vdi-rrqm/s vdi-wrqm/s vdi-r/s vdi-w/s vdi-rkB/s vdi-wkB/s vdi-avgrq-sz vdi-avgqu-sz vdi-await vdi-r_await vdi-w_await vdi-svctm vdi-%util
Wed Dec 16 10:32:30 GMT 2015 0.00    0.00    0.00    2.00    0.00    4.00    4.00    0.24    128.00  0.00    128.00  121.00  24.20   0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  0.00     0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    2.00    1.00    1.00    0.50    1.00    0.11    36.67   33.00   44.00 36.67    11.00   0.00    0.00    2.00    1.00    1.00    0.50    1.00    0.04    14.67   0.00    44.00   14.67   4.40    0.00    0.00    2.00    1.00    1.00    0.50    1.00    0.10    31.67   25.50 44.00    31.67   9.50    0.00    0.00    43.00   23.00   400.00  97.00   15.06   3.83    57.05   62.37   47.09   15.15   100.00  0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  0.00     0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.24  0.00     0.00    0.00    0.00    24.20   0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    39.00   23.00   320.00  78.50   12.85 1.11     17.40   2.85    42.09   12.39   76.80

I regret for re-work as I misunderstood the requirement.

Thanks in advance.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Convert Header into Column in Text file

Hi Gurus, I have a requirement like this and have to create a UX shell scripts. Thanks in advance. File-in: ------ Header2007-12-012007-11-21 100|xyz|was 101|wsa|qws ...... ....... Output should be: ------------------- 2007-12-01|100|xyz|was 2007-12-01|101|wsa|qws ...... .......... (7 Replies)
Discussion started by: vsubbu1000
7 Replies

2. Shell Programming and Scripting

convert rows into column

if u have a data 2 4 6 8 5 4 4 5 6 then result shud be like 2 4 6 7 5 4 4 5 6 (3 Replies)
Discussion started by: cdfd123
3 Replies

3. UNIX for Dummies Questions & Answers

How to convert a single column into several rows and columns?

I have a program which gives me the output as a single column with hundreds of rows like: 213 314 324 324 123 I want to be able to create a new file from this file which allows me to set the number of rows and columns in the new file, i.e. for this example, if I specify 3 rows and 2... (5 Replies)
Discussion started by: ashton_smith
5 Replies

4. Shell Programming and Scripting

Convert Column to rows

Hi, I have a file with below contents. Heading1 Heading2 Heading3 Heading4 Value1 Value2 Value3 Value4 The file has only 2 rows and is tab separated The desired output is : Heading1 Value1 Heading2 Value2 Heading3 Value3 Heading4 Value4 CAn you please help? (5 Replies)
Discussion started by: kaponeh
5 Replies

5. Shell Programming and Scripting

Convert rows into column groups

Hi I have the text file like this "A" "AA Info" "AA Text" "AAA" "ABC" "ABC Info" "ABC Tech" "AGH" "SYN" "SYMBony" "SYN BEREN" Like about 2000 lines Output would be in Column with groups like following "A" "AA Info", "AA Text" "AAA" "ABC","ABC Info","ABC Tech" (0 Replies)
Discussion started by: selvanraj
0 Replies

6. Shell Programming and Scripting

Convert Rows into Column

Hi Experts, I have a requirement to convert rows into columns. For e.g. Input File: Output File should be like Appreciate if you could suggest code snippet(may be awk) for above requirement... Thanks in Advance for your help... (3 Replies)
Discussion started by: sai_2507
3 Replies

7. Shell Programming and Scripting

Convert header rows into

I want to put the 3 first lines into a single line separated by ; I've tried to use Sed and Awk but without success. I'm new to Shell scripting. Thanks in advance! Input 112 DESAC_201309_OR_DJ10 DJ10 1234567890123;8 1234567890124;20 1234567890125;3 expected Output... (8 Replies)
Discussion started by: MoroccanRoll
8 Replies

8. Shell Programming and Scripting

Convert single column into multiple rows

Convert Single column to multiple rows file a.txt contains data like below Server=abc Run=1 Tables=10 Sessions=16 Time=380 Jobs=5 Server=abc Run=2 Tables=15 Sessions=16 Time=400 Jobs=5 Server=abc Run=3 Tables=20 Sessions=16 Time=450 (5 Replies)
Discussion started by: sol_nov
5 Replies

9. Shell Programming and Scripting

Convert rows to column and add header

Hi, I need help to convert rows in input file into a table. inputfile 192.98.1 192.98.192.98.17 VVC family Zorro 10 192.98.1 192.98.192.98.17 VVC family Ace 1 192.98.1 192.98.192.98.17 VVC family ... (4 Replies)
Discussion started by: redse171
4 Replies

10. Shell Programming and Scripting

Convert Column data values to rows

Hi all , I have a file with the below content Header Section employee|employee name||Job description|Job code|Unitcode|Account|geography|C1|C2|C3|C4|C5|C6|C7|C8|C9|Csource|Oct|Nov|Dec|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep Data section ... (1 Reply)
Discussion started by: Hypesslearner
1 Replies
ppmtosixel(1)						      General Commands Manual						     ppmtosixel(1)

NAME
ppmtosixel - convert a portable pixmap into DEC sixel format SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile] DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC LJ250 color inkjet printer. If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file. OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com- pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni- tude larger than a compressed file and prints much slower. -margin If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci- fied, a 1.5 inch left margin will offset the image. PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?. BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation. SEE ALSO
ppm(5) AUTHOR
Copyright (C) 1991 by Rick Vinci. 26 April 1991 ppmtosixel(1)
All times are GMT -4. The time now is 07:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy