Sponsored Content
Top Forums Shell Programming and Scripting Format - Inventory Row data into Column - Awk - Nawk Post 302310335 by aavam on Friday 24th of April 2009 10:43:45 AM
Old 04-24-2009
Format - Inventory Row data into Column - Awk - Nawk

Hi All,

I have the following file that has computer data for various pcs in my network...

Snap of the file is as follows

*******************************************************************************
Serial
123456

Computer IP Address
lo0: flags=12345687<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ffff0000
bge0: flags=1234667<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS> mtu 1500 index 2
inet 1.2.3.4 netmask fff00000 broadcast 1.2.3.4

Make of Machine
SunOS test 5.10 Generic_123456-02 sun4u sparc SUNW,Sun-Fire-V440

CPU Processor Info
The physical processor has 1 virtual processor (0)
UltraSPARC-IIIi (portid 0 impl 0x16 ver 0x18 clock 1002 MHz)
The physical processor has 1 virtual processor (1)
UltraSPARC-IIIi (portid 1 impl 0x16 ver 0x18 clock 1002 MHz)

Memory Info
Memory size: 4144 Megabytes

Disk Info
Vendor: SEAGATE Product: ST123456LSUN22G Revision: 0101 Serial No: 12345678
Size: 73.40GB <73400057856 bytes>
Vendor: SEAGATE Product: ST13456LSUN12G Revision: 0202 Serial No: 12345678
Size: 73.40GB <73400057856 bytes>
*******************************************************************************

*******************************************************************************
Serial
1357921

Computer IP Address
lo0: flags=12345687<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ffff0000
bge0: flags=1234667<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS> mtu 1500 index 2
inet 1.2.3.5 netmask fff00000 broadcast 1.2.3.4

Make of Machine
SunOS test1 5.10 Generic_123456-02 sun4u sparc SUNW,Sun-Fire-V440

CPU Processor Info
The physical processor has 1 virtual processor (0)
UltraSPARC-IIIi (portid 0 impl 0x16 ver 0x18 clock 1002 MHz)
The physical processor has 1 virtual processor (1)
UltraSPARC-IIIi (portid 1 impl 0x16 ver 0x18 clock 1002 MHz)

Memory Info
Memory size: 8144 Megabytes

Disk Info
Vendor: SEAGATE Product: ST123456LSUN22G Revision: 0101 Serial No: 12345678
Size: 73.40GB <73400057856 bytes>
Vendor: SEAGATE Product: ST13456LSUN12G Revision: 0202 Serial No: 12345678
Size: 73.40GB <73400057856 bytes>
*******************************************************************************
.
.
.
.
.
.
.
.

.
********************************************************************************


I like to run a script in unix preferably in Awk or any simple shell code to product the following output


Output Should look like this

Serial Computer IP Address Make of Machine CPU Processor Info Memory Info Vendor Size

1234567 1.2.3.4 SunOS test..Sun-Fire-V440 UltraSPARC-IIIi 4144 Megabytes Seagate 73.4 GB
UltraSPARC-IIIi Seagte 73.4 GB

1357921 1.2.3.5 SunOS test1..Sun-Fire-V440 UltraSPARC-IIIi 8144 Megabytes Seagate 73.4 GB
UltraSPARC-IIIi Seagte 73.4 GB

*********************************************************

I can then import data in excel or any other data base......

Any suggestions or hint would be greatly appreciated.... Thank you in advance for your time and support....
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

row to column and position data in to fixed column width

Dear friends, Below is my program and current output. I wish to have 3 or 4 column output in order to accomodate in single page. i do have subsequent command to process after user enter the number. Program COUNT=1 for MYDIR in `ls /` do VOBS=${MYDIR} echo "${COUNT}. ${MYDIR}" ... (4 Replies)
Discussion started by: baluchen
4 Replies

2. Shell Programming and Scripting

Moving data from a specified column/row to another column/row

Hello, I have an input file like the following: 11_3_4 2_1_35 3_15__ _16989 Where '_' is a space. The data is in a table. Is there a way for the program to prompt the user for x1,y1 and x2,y2, where x1,y1 is the desired number (for example x=6 y=4 is a value of 4) and move to a desired spot... (2 Replies)
Discussion started by: jl487
2 Replies

3. Shell Programming and Scripting

Sort a the file & refine data column & row format

cat file1.txt field1 "user1": field2:"data-cde" field3:"data-pqr" field4:"data-mno" field1 "user1": field2:"data-dcb" field3:"data-mxz" field4:"data-zul" field1 "user2": field2:"data-cqz" field3:"data-xoq" field4:"data-pos" Now i need to have the date like below. i have just... (7 Replies)
Discussion started by: ckaramsetty
7 Replies

4. Shell Programming and Scripting

Awk to add selected row column data

Looks at the most efficient way to add up the column of data based off of the rows. Random data Name-Number-ID Sarah-2.0-15 Bob-6.3-15 Sally-1.0-10 James-1.0-10 Scotty-10.7-15 So I would select all those who have ID = 15 and then add up total number read - p "Enter ID number" Num ... (3 Replies)
Discussion started by: Ironguru
3 Replies

5. Shell Programming and Scripting

Subtracting each row from the first row in a single column file using awk

Hi Friends, I have a single column data like below. 1 2 3 4 5 I need the output like below. 0 1 2 3 4 where each row (including first row) subtracting from first row and the result should print below like the way shown in output file. Thanks Sid (11 Replies)
Discussion started by: ks_reddy
11 Replies

6. UNIX for Advanced & Expert Users

Convert column data to row data using shell script

Hi, I want to convert a 3-column data to 3-row data using shell script. Any suggestion in this regard is highly appreciated. Thanks. (4 Replies)
Discussion started by: sktkpl
4 Replies

7. Shell Programming and Scripting

awk - script help: column to row format of data allignment?

Experts Good day, I have the following data, file1 BRAAGRP1 A2X B2X C2X D2X BRBGRP12 A3X B3X Z10 D09 BRC1GRP2 LO01 (4 Replies)
Discussion started by: rveri
4 Replies

8. UNIX for Dummies Questions & Answers

awk to print first row with forth column and last row with fifth column in each file

file with this content awk 'NR==1 {print $4} && NR==2 {print $5}' file The error is shown with syntax error; what can be done (4 Replies)
Discussion started by: cdfd123
4 Replies

9. UNIX for Dummies Questions & Answers

Des/awk for change format and adding integers in a column of data?

Greetings! I need a quick way to change the format in a table of data Here is an example of the input: 10 72 Value=177 VDB=0.0245 Value4=0,0,171,0 10 274 Value=238 VDB=0.0433 Value4=29,0,205,0 10 312 Value=222 VDB=0.0384 Value4=8,0,190,19 10 540 Value=405 VDB=0.0391 Value4=13,30,153,195... (3 Replies)
Discussion started by: Twinklefingers
3 Replies

10. Shell Programming and Scripting

How to get row data printed in column using awk?

Hi team, I have below sample file. $ cat sample dn: MSISDN=400512345677,dc=msisdn,ou=NPSD,serv=CSPS,ou=servCommonData,dc=stc structuralObjectClass: NphData objectClass: NphData objectClass: MSISDN entryDS: 0 nodeId: 35 createTimestamp: 20170216121047Z modifyTimestamp: 20170216121047Z... (3 Replies)
Discussion started by: shanul karim
3 Replies
aa_fastrender(3)					     Library Functions Manual						  aa_fastrender(3)

NAME
aa_fastrender - simple and fast AA-lib rendering function. SYNOPSIS
#include <aalib.h> void aa_fastrender ( aa_context *c, int x1, int y1, int x2, int y2 ); PARAMETERS
aa_context *c Specifies the AA-lib context to operate on. int x1 Column of top left coner of rendered area (in characters!). int y1 Row of top left coner of rendered area. int x2 Column of bottom right coner of rendered area. int y2 Row of bottom right coner of rendered area. DESCRIPTION
This function does the trick of converting the emulated framebuffer into high quality ASCII-art. It is slightly faster and less flexible the aa_render function. Note that to see the effect you need to call aa_flush too. First call to this function may take a while, because the rendering tables are produced. SEE ALSO
save_d(3), mem_d(3), aa_help(3), aa_formats(3), aa_fonts(3), aa_dithernames(3), aa_drivers(3), aa_kbddrivers(3), aa_mousedrivers(3), aa_kbdrecommended(3), aa_mouserecommended(3), aa_displayrecommended(3), aa_defparams(3), aa_defrenderparams(3), aa_scrwidth(3), aa_scrheight(3), aa_mmwidth(3), aa_mmheight(3), aa_imgwidth(3), aa_imgheight(3), aa_image(3), aa_text(3), aa_attrs(3), aa_currentfont(3), aa_autoinit(3), aa_autoinitkbd(3), aa_autoinitmouse(3), aa_recommendhi(3), aa_recommendlow(3), aa_init(3), aa_initkbd(3), aa_initmouse(3), aa_close(3), aa_uninitkbd(3), aa_uninitmouse(3), aa_render(3), aa_puts(3), aa_printf(3), aa_gotoxy(3), aa_hidecursor(3), aa_showcursor(3), aa_getmouse(3), aa_hidemouse(3), aa_showmouse(3), aa_registerfont(3), aa_setsupported(3), aa_setfont(3), aa_getevent(3), aa_getkey(3), aa_resize(3), aa_resizehandler(3), aa_parseoptions(3), aa_edit(3), aa_createedit(3), aa_editkey(3), aa_putpixel(3), aa_recommendhikbd(3), aa_recommendlowkbd(3), aa_recommendhimouse(3), aa_recommendlowmouse(3), aa_recommendhidisplay(3), aa_recommendlowdisplay(3) c2man aalib.h 8 September 1999 aa_fastrender(3)
All times are GMT -4. The time now is 02:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy