Sponsored Content
Full Discussion: building table from list
Top Forums Shell Programming and Scripting building table from list Post 302379245 by f_o_555 on Thursday 10th of December 2009 02:50:37 AM
Old 12-10-2009
building table from list

Hi,
I have a file with the following structure

Code:
M17XX-050-01-001 1100000000
A16	1.341E+05
...
B18	3.084E+02
total	1.344E+05
XY35	5.694E+03
...
XY241	6.725E+02
total	9.897E+05
Wr81Z	5.195E+00
...
Wr91Z	1.029E+02
Wr92Z	1.285E+02
total	9.897E+05
M17XX-050-01-001 1010000000
A16	1.341E+05
...
B18	3.084E+02
total	1.344E+05
XY35	5.694E+03
...
XY241	6.725E+02
total	9.897E+05
Wr81Z	5.195E+00
...
Wr91Z	1.029E+02
Wr92Z	1.285E+02
total	9.897E+05
etc..

So a set of data which start with a string like
M17XX-050-01-001 1100000000
after that there are 3 subset of data. The end of each subset of data is givel by the line starting with the string "total"

I would like to put the data in a table like format, without repeating the first of each string. Somwthing like

Code:
A16	1.34E+05	1.34E+05 ...
B18	3.08E+02	3.08E+02 ...
total	1.34E+05	1.34E+05
XY35	5.69E+03	5.19E+03
XY38	9.37E+05	9.33E+05
XY238	9.41E+02	9.25E+02
XY239	2.40E+04	2.19E+04
XY240	1.20E+04	1.21E+04
XY241	5.64E+03	5.97E+03
XY242	3.19E+03	3.33E+03
XY241	6.73E+02	6.36E+02
total	9.90E+05	5.59E+02
Wr81Z	5.20E+00	9.85E+05
We82Z	7.15E+00	7.69E+00
Wr83Z	1.06E+01	1.07E+01
Wr84Z	2.04E+01	1.56E+01
Wb85Z	1.71E+01	3.08E+01
Wr86Z	3.24E+01	2.55E+01
Wb87Z	4.21E+01	4.83E+01
Wr88Z	5.86E+01	6.27E+01
W89	7.18E+01	8.73E+01

The main problem is that the structure of each subset is not necessarly always the same. E.g. one line might be missing.
So I would like to define a subset of strings
e.g.

Code:
We82Z, Wr83Z, Wr84Z, Wb85Z

and then build a table according to the value they have in the file.
If the do not appear I would put 0.

Any idea at least how to tackle the problem?
Thanks,
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Crosstab to List table using awk Function

What I am trying to achieve is turning crosstab into a normal table e.g. convert following table Jan Feb Mar Apr May Jun Australia 1 2 3 4 5 6 USA 7 8 9 10 11 12 China 13 14 15 16 17 18 to Australia Jan 1 Australia Feb 2 Australia Mar 3 ... (2 Replies)
Discussion started by: asdban
2 Replies

2. UNIX for Advanced & Expert Users

Rsync building file list/catalog path/location

Where is the file list created by rsync when it says building file list ? (1 Reply)
Discussion started by: glev2005
1 Replies

3. Shell Programming and Scripting

select values from db1 table and insert into table of DB2

Hi I am having three oracle databases running in three different machine. their ip address is different. from one of the DB am able to access both the databases.(means am able to select values and insert values in to tables individually.) I need to fetch some data from DB1 table(say DB1 ip is... (2 Replies)
Discussion started by: aemunathan
2 Replies

4. UNIX and Linux Applications

create table via stored procedure (passing the table name to it)

hi there, I am trying to create a stored procedure that i can pass the table name to and it will create a table with that name. but for some reason it creates with what i have defined as the variable name . In the case of the example below it creates a table called 'tname' for example ... (6 Replies)
Discussion started by: rethink
6 Replies

5. UNIX for Dummies Questions & Answers

Reading Table name from a list of files in a Directory

Hi , I have searched through the forum but not able to find out any help :( i have a directory having lot of files which contains sql statemtns eg : file 1 contains select from table_name1 where ..................... select from table_name2 where .......... select from ... (3 Replies)
Discussion started by: Trendz
3 Replies

6. Shell Programming and Scripting

Reformatting a list to table

Hi! I have a list with a lot of records that I need to work with. The problem is that the list is populated successive one record at the time in a text file, and to gain anything from these records I need them to be put out in a table. This is an example of what the list looks like: (145)... (5 Replies)
Discussion started by: ivar.friheim
5 Replies

7. UNIX for Dummies Questions & Answers

Creating a condensed table from a pre-existing table in putty

Hello, I'm working with putty on Windows 7 professional and I'd like to know if there's a way to gather specific lines from a pre-existing table and make a new table with that information. More specifically, I'd like the program to look at a specific column, say column N, and see if any of the... (5 Replies)
Discussion started by: Deedee393
5 Replies

8. Shell Programming and Scripting

Build a table from a list by comparing existing table entries

I am new to this shell scripting.... I have a file which contains list of users. This files get updated when new user comes into the system. I want to create script which will give a table containing unique list of users. When I say unique, it means script should match table while parsing... (3 Replies)
Discussion started by: dchavan1901
3 Replies

9. UNIX for Beginners Questions & Answers

Building hierarchy with the list

Hi All, Sorry for more question today. I am having a text file . Like below 704925680_TOTAL->MANUAL->TT IOR GSB 775116444_TOTAL->POO TO->TT -572275295_TOTAL->MANUAL->MTO -611408278_TOTAL->PRIE LEL 456690129_TOTAL->BTT TOO 475919266_TOTAL->MANUAL->COM -172680236_TOTAL->BTT TOO->MTO... (15 Replies)
Discussion started by: arunkumar_mca
15 Replies

10. Web Development

Getting Rid of Annoying Bootstrap Table Borders and Wayward Table Lines

Bootstrap is great; but we have had some issues with Bootstrapped <tables> (and legacy <fieldset> elements) showing annoying, wayward lines. I solved that problem today with this simple jQuery in the footer: <script> $(function(){ $('tr, td, fieldset,... (0 Replies)
Discussion started by: Neo
0 Replies
auditstat(1M)						  System Administration Commands					     auditstat(1M)

NAME
auditstat - display kernel audit statistics SYNOPSIS
auditstat [-c count] [-h numlines] [-i interval] [-n] [-v] DESCRIPTION
auditstat displays kernel audit statistics. The fields displayed are as follows: aud The total number of audit records processed by the audit(2) system call. ctl This field is obsolete. drop The total number of audit records that have been dropped. Records are dropped according to the kernel audit policy. See auditon(2), AUDIT_CNT policy for details. enq The total number of audit records put on the kernel audit queue. gen The total number of audit records that have been constructed (not the number written). kern The total number of audit records produced by user processes (as a result of system calls). mem The total number of Kbytes of memory currently in use by the kernel audit module. nona The total number of non-attributable audit records that have been constructed. These are audit records that are not attributable to any particular user. rblk The total number of times that the audit queue has blocked waiting to process audit data. tot The total number of Kbytes of audit data written to the audit trail. wblk The total number of times that user processes blocked on the audit queue at the high water mark. wrtn The total number of audit records written. The difference between enq and wrtn is the number of outstanding audit records on the audit queue that have not been written. OPTIONS
-c count Display the statistics a total of count times. If count is equal to zero, statistics are displayed indefinitely. A time interval must be specified. -h numlines Display a header for every numlines of statistics printed. The default is to display the header every 20 lines. If numlines is equal to zero, the header is never displayed. -i interval Display the statistics every interval where interval is the number of seconds to sleep between each collection. -n Display the number of kernel audit events currently configured. -v Display the version number of the kernel audit module software. EXIT STATUS
auditstat returns 0 upon success and 1 upon failure. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
auditconfig(1M), praudit(1M), bsmconv(1M), audit(2), auditon(2), attributes(5) NOTES
The functionality described in this man page is available only if the Basic Security Module (BSM) has been enabled. See bsmconv(1M) for more information. SunOS 5.11 11 Feb 2008 auditstat(1M)
All times are GMT -4. The time now is 03:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy