help [[row and columns]]


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting help [[row and columns]]
# 1  
Old 05-19-2011
Data help [[row and columns]]

i ask to do ,,program that convert the last row to be the first row ,,,and after that exchange the the columns
ex,,
1 2 3
4 5 6
7 8 9
to be
7 8 9
4 5 6
1 2 3
and then to be
9 8 7
6 5 4
3 2 1
give mee the code ....
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Transpose columns to row

Gents Using the attached file and using this code. awk '{print substr($0,4,2)}' input.txt | sort -k1n | awk '{a++}END{for(i in a) print i,a}' | sort -k1 > output i got the this output. 00 739 01 807 02 840 03 735 04 782 05 850 06 754 07 295 08 388 09 670 10 669 11 762 (8 Replies)
Discussion started by: jiam912
8 Replies

2. UNIX for Dummies Questions & Answers

Select 2 columns and transpose row by row

Hi, I have a tab-delimited file as follows: 1 1 2 2 3 3 4 4 a a b b c c d d 5 5 6 6 7 7 8 8 e e f f g g h h 9 9 10 10 11 11 12 12 i i j j k k l l 13 13 14 14 15 15 16 16 m m n n o o p p The output I need is: 1 1 a a 5 5 e e 9 9 i i 13... (5 Replies)
Discussion started by: mvaishnav
5 Replies

3. UNIX for Dummies Questions & Answers

Dividing all columns by the nth row

Hi All! if I have a file like this: 8 10 12 14 16 18 0 2 6 2 4 6 8 10 12 16 18 10 6 8 12 16 18 0 2 2 6 2 2 2 2 2 2 2 2 2 10 12 16 4 8 16 4 16 0 8 10 14 16 0 4 8 12 14 And I want to divide all the lines by line 4 for example... (6 Replies)
Discussion started by: cosmologist
6 Replies

4. UNIX for Dummies Questions & Answers

help [[row and columns]]

i ask to do ,,program that convert the last row to be the first row ,,,and after that exchange the the columns ex,, 1 2 3 4 5 6 7 8 9 to be 7 8 9 4 5 6 1 2 3 and then to be 9 8 7 6 5 4 3 2 1 (0 Replies)
Discussion started by: khaled1989kh
0 Replies

5. Shell Programming and Scripting

Print columns from each row

I have awk command to print column 8 awk '/select/ {print $8}' which will print column 8 But I need to print 3, 5 and 8 column in a row and each column should be de-limited by "\t" Hope anyone help me quickly. (2 Replies)
Discussion started by: elamurugu
2 Replies

6. UNIX for Dummies Questions & Answers

convert matrix to row and columns

Dear Unix Gurus, I have a sample data set that looks like this y1 y2 y3 y4 y5 x1 0.3 0.5 2.3 3.1 5.1 x2 1.2 4.1 3.5 1.7 1.2 x3 3.1 2.1 1.0 4.1 2.1 x4 5.0 4.0 6.0 7.0 1.1 I want to open it up so that I get x1 y1 0.3 x2 y1 1.2 x3 y1 3.1 x4 y1 5.0 x1 y2 0.5 x2 y2... (3 Replies)
Discussion started by: tintin72
3 Replies

7. Shell Programming and Scripting

Row to Columns question

Hi, I have a question for Row to Columns by script. e.g. i have a file Start 1 2 3 4 End Start 1 2 3 3 4 4 End (6 Replies)
Discussion started by: bleach8578
6 Replies

8. Shell Programming and Scripting

3 Columns to Row question

I have a file that looks like this... a b c d e f g h i I would like to it to be like this a b c d e f g h i Thanks (8 Replies)
Discussion started by: elbombillo
8 Replies

9. Shell Programming and Scripting

how to change row into columns

hi, I have a input file like a,123,456,789,012,.......,b I need to change the output file into a,123,b a,456,b a,789,b a,012,b a,...,b like that.. how to achieve that through UNIX................. (5 Replies)
Discussion started by: aaha_naga
5 Replies

10. UNIX for Dummies Questions & Answers

Row to Columns

Hi, I have a file like this. 1,1,1,0,0,0 1,1,2,1,0,0 1,1,3,0,0,0 1,1,4,0,0,0 ........... ........... 1,1,24,0,0,0 1,1,25,0,0,0 1,1,26,1,0,0 1,1,27,0,0,0 1,2,1,0,0,0 1,2,2,0,0,0 1,2,3,0,0,0 1,2,4,0,0,0 1,2,5,1,0,0 1,2,6,1,0,0 (4 Replies)
Discussion started by: vskr72
4 Replies
Login or Register to Ask a Question
RowColHandler(3pm)					  LogReport's Lire Documentation					RowColHandler(3pm)

NAME
Lire::ReportParser::RowColHandler - Lire::ReportParser subclass which synthetize row SYNOPSIS
In XML Report processors: package MyParser; use base qw/Lire::ReportParser::RowColHandler/; sub handle_header_row { my ( $self, $row ) = @_; ... } sub handle_row { my ( $self, $row ) = @_; ... } sub handle_table_summary { my ( $self, $nrecords, $row ) = @_; .... } DESCRIPTION
The Lire::ReportParser::RowColHandler module is a Lire::ReportParser subclass which will synthetize handle_row() events. This makes it easier to write subclases which onlypurpose is to format the report. Instead of having to reconstruct the table row from the various entry_start, group_start, handle_name, events, the subclass only has to process handle_row() events. USING Lire::ReportParser::RowColHandler Client only have to inherit from Lire::ReportParser::RowColHandler. After that, they can define handle_row(), handle_header_row() and handle_table_summary() method. There is a parameter that the RowColHandler accepts and its "summary_when" which specify when the handle_table_summary() event will be synthetised ( "before" or "after" the table's body.) When it's "before" the event will be generated after the header_row events but before any handle_row() events. Otherwise, it will be generated once all handle_row() events are processed. The default is "before". handle_table_summary( $nrecords, $row ) Called after the table summary is available (and depending on the "summary_when" initialisation parameter). $nrecords contains the number of records used to compute the report and $row is an array reference to the table summary value. The $row array contains as much elements as there is columns in the table. Only the numerical column will have a value in there, others will be set to undef. The summary value are hash reference containing the same values than is available in the Lire::ReportParser's handle_summary_value() event. handle_header_row( $row ) This will called once for each header row there is. The first header row contains all the numerical columns as well as the main categorical column. $row is an array reference containing as much element as there is columns in the table. Column's labels which shouldn't appear on this row are undef. Other elements will contain the related Lire::Report::ColumnInfo object. handle_row( $row ) This event will be called for each row to display in the table. $row is an array reference containing the data that should appear in the row. It contains as many elements as there are columns defined in the table. Empty column will have undef as content. Other elements will be an hash reference identical to what would be received in the handle_name() or handle_value() method of Lire::ReportParser. The only difference is that summary value will have a key "is_summary" set to 1. In the case of spanning columns, the data element will be in the col_start() element. The other cells will be undef. SEE ALSO
Lire::ReportParser(3pm) Lire::Report::ColumnInfo(3pm) VERSION
$Id: RowColHandler.pm,v 1.13 2006/07/23 13:16:31 vanbaal Exp $ COPYRIGHT
Copyright (C) 2002 Stichting LogReport Foundation LogReport@LogReport.org This file is part of Lire. Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html. AUTHOR
Francis J. Lacoste <flacoste@logreport.org> Lire 2.1.1 2006-07-23 RowColHandler(3pm)