Sponsored Content
Full Discussion: How to read tabular data?
Top Forums UNIX for Dummies Questions & Answers How to read tabular data? Post 302357291 by jim mcnamara on Tuesday 29th of September 2009 09:55:29 AM
Old 09-29-2009
Code:
awk ' /^TOTAL/ {rowtotal= $1 + $2 + $3}
        { coltotal+=$1}
       END {printf "column total=", coltotal," row total=", rwototal }'  inputfile > outputfile

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

converting a tabular format data to comma seperated data in KSH

Hi, Could anyone help me in changing a tabular format output to comma seperated file pls in K-sh. Its very urgent. E.g : username empid ------------------------ sri 123 to username,empid sri,123 Thanks, Hema:confused: (2 Replies)
Discussion started by: Hemamalini
2 Replies

2. Shell Programming and Scripting

How to find max value in a tabular data?

FILE_NAME VER TYPE DELETED_DATE CREATED_DATE SIZE LOCATION hello 1 d 2010-08-09 2010-08-09 4096 /home/xxxxx/project/ hello 2 d 2010-08-09 2010-08-09 4096 /home/xxxxx/project/ hello 3 d 2010-08-09 2010-08-09 4096 /home/xxxxx/project/ hello 4 d 2010-08-09 2010-08-09 4096 /home/xxxxx/project/ ... (4 Replies)
Discussion started by: classic
4 Replies

3. UNIX for Dummies Questions & Answers

Put data into tabular form

Hi I am having a file which is required to be presented in the under-noted output form. Please suggest. Input: Kapil: apple 4 banana 6 cherry 0 Manoj: apple 13 banana cheery 2 Output: apple banana cherry Kapil: 4 6 0 Manoj: 13 2 Thanks in... (4 Replies)
Discussion started by: vanand420
4 Replies

4. UNIX for Dummies Questions & Answers

Put data in tabular form..

Dear Friends, I have a file as under : +++ ME 12-06-13 18:16:20 A RED FEW AND ROW1 1MN FEL AS HI FI BV LR TS HR ES MR * 0 13296 0 120 1 15 KS RR 10 0 +++ ME 12-06-13 18:26:20 A RED FEW AND ROW2 1MN FEL AS... (2 Replies)
Discussion started by: vanand420
2 Replies

5. Shell Programming and Scripting

Generate tabular data based on a column value from an existing data file

Hi, I have a data file with : 01/28/2012,1,1,98995 01/28/2012,1,2,7195 01/29/2012,1,1,98995 01/29/2012,1,2,7195 01/30/2012,1,1,98896 01/30/2012,1,2,7083 01/31/2012,1,1,98896 01/31/2012,1,2,7083 02/01/2012,1,1,98896 02/01/2012,1,2,7083 02/02/2012,1,1,98899 02/02/2012,1,2,7083 I... (1 Reply)
Discussion started by: himanish
1 Replies

6. Shell Programming and Scripting

Extract data in tabular format from multiple files

Hi, I have directory with multiple files from which i need to extract portion of specif lines and insert it in a new file, the new file will contain a separate columns for each file data. Example: I need to extract Value_1 & Value_3 from all files and insert in output file as below: ... (2 Replies)
Discussion started by: belalr
2 Replies

7. Shell Programming and Scripting

Convert data to a tabular format

How can i convert the below data to a simpler format :- cat tabular.txt User 1 Details :- First Name = Tom Middle Name = Last Name = Hanks Age = 40 Address = User 2 details :- First Name = Mike Middle Name = Last Name = Tyson Age = 50 Address = (2 Replies)
Discussion started by: lazydev
2 Replies

8. Shell Programming and Scripting

Convert data into tabular matrix

Hi There, I want to convert the following data into tabular matrix, based on column 4th and 5th, and output the column 10th value chr1 2804449 2804450 NACpG_1 window1 + chr1 2804443 2804475 1 chr1 2804450 2804451 NACpG_1 window2 + chr1 2804443 ... (3 Replies)
Discussion started by: ChiragNepal
3 Replies

9. Shell Programming and Scripting

Merge and Sort tabular data from different text files

I have 42 text files; each containing up to 34 lines with following structure; file1 H-01 23 H-03 5 H-05 9 H-02 14 . . file2 H-01 17 H-02 43 H-04 7 H-05 8 H-03 7 . . file3 (6 Replies)
Discussion started by: Syeda Sumayya
6 Replies

10. Shell Programming and Scripting

Fetching the required data out of a tabular form

Hello Gurus, I am trying to fetch a required number of lines from an output of a command which is in tabular form. Below is the command for reference along with how the result is being shown on UNIX shell. /usr/openv/volmgr/bin/vmquery -b -p 5 The result of the above command is as... (6 Replies)
Discussion started by: Ali Sarwar
6 Replies
AMTOC(8)						      System Manager's Manual							  AMTOC(8)

NAME
amtoc - generate TOC (Table Of Contents) for an Amanda run SYNOPSIS
amtoc [ -a ] [ -i ] [ -t ] [ -f file ] [ -s subs ] [ -w ] [ -- ] logfile DESCRIPTION
Amtoc generates a table of contents for an Amanda run. It's a perl script (if you don't have perl, install it first!). OPTIONS
-a The output file name will be label-of-the-tape.toc in the same directory as logfile. -i Display help about amtoc. -t Generate the output in tabular form. -f file Write the output to a file ('-' for stdout). -s subs Evaluate the output file name from subs, with $_ set to label-of-the-tape. The -a option is equivalent to -s 's/$_/.toc/'. -w Separate tapes with form-feeds and display blank lines before totals. -- Marks the last option so the next parameter is the logfile. logfile (use '-' for stdin) OUTPUT FORMAT
The standard output has five fields separated by two spaces: # Server:/partition date level size[Kb] 0 daily-05: 19991005 - - 1 cuisun15:/cuisun15/home 19991005 1 96 2 cuinfs:/export/dentiste 19991005 1 96 ... 103 cuisg11:/ 19991005 0 4139136 103 total: - - 16716288 In tabular format (-t), this would look like: # Server:/partition date lev size[Kb] 0 daily-05: 19991005 - - 1 cuisun15:/cuisun15/home 19991005 1 96 2 cuinfs:/export/dentiste 19991005 1 96 ... 103 cuisg11:/ 19991005 0 4139136 103 total: - - 16716288 USAGE
The easiest way to use it is to run amtoc right after amdump in the cron job: amdump DailySet1 ; logdir=`amgetconf DailySet1 logdir` ; log=`ls -1t $logdir/log.*.[0-9] | head -1` ; amtoc -a $log which will generate /etc/amanda/DailySet1/tape_label.toc. You may also want to call amtoc after an amflush. SEE ALSO
amanda(8), amdump(8), amflush(8), amgetconf(8), cron, perl AUTHOR
Nicolas MAYENCOURT <Nicolas.Mayencourt@cui.unige.ch> University of Geneva/Switzerland AMTOC(8)
All times are GMT -4. The time now is 09:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy