Sponsored Content
Operating Systems Linux Ubuntu How to convert full data matrix to linearised left data matrix? Post 302527327 by kumaran_5555 on Friday 3rd of June 2011 05:35:07 AM
Old 06-03-2011
Hope this is what you are looking for
Code:
cgi@tioman> (/home/cgi) $ awk '{if(NR==1){print}else{for(i=1;i<=NF;i++){ printf "%s\t",$i ;if($i==0){printf "\n"; next} }}}' test.txt

      Bh1 Bh2 Bh3 Bh4 Bh5 Bh6 Bh7
Bh1     0
Bh2     0.241058        0
Bh3     0.236129        0.240594        0
Bh4     0.244397        0.241931        0.24126 0
Bh5     0.237479        0.241975        0.240514        0.245298        0
Bh6     0.240767        0.236266        0.237112        0.243085        0.241861        0
Bh7     0.245245        0.239739        0.246041        0.248259        0.244328        0.241861        0

This User Gave Thanks to kumaran_5555 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

changing data into matrix form

Hi, I have a file whose structure is like this 7 7 1 2 3 4 5 1 3 4 8 6 1 4 5 6 0 2 6 8 3 8 2 5 7 8 0 5 7 9 4 1 3 8 0 2 2 3 5 6 8 basically first two row tell the number of rows and column but the data following them are not arranged in that format. now i want to create another... (1 Reply)
Discussion started by: g0600014
1 Replies

2. Shell Programming and Scripting

Merge 70 files into one data matrix

Hi, I have a list of 70 files in a directory and I need to merge the content of each file into one big matrix file (71 columns x 3060 rows). Each file has the following format only two columns per file: unique identifier1 randomtext1 randomtext1 a 5 b 3 c 6 d 3 e 2... (11 Replies)
Discussion started by: labrazil
11 Replies

3. Shell Programming and Scripting

extract data from a data matrix with filter criteria

Here is what old matrix look like, IDs X1 X2 Y1 Y2 10914061 -0.364613333 -0.362922333 0.001691 -0.450094667 10855062 0.845956333 0.860396667 0.014440333 1.483899333... (7 Replies)
Discussion started by: ssshen
7 Replies

4. Shell Programming and Scripting

Invert Matrix of Data - Perl

I have columnar data in arrays perl, Example - @a = (1,2,3); @array1 = (A,B,C); @array2 = (D,E,F); @array3 = (I,R,T); I want the data to be formatted and printed as 1 A D I 2 B E F 3 C F T and so on... (8 Replies)
Discussion started by: dinjo_jo
8 Replies

5. Shell Programming and Scripting

two-column data to matrix in AWK

Howdy, I need to convert an association data matrix, currently in a two-column format, into a matrix with numbers indicating the number of associations. I've been looking around for AWK code in the list, but could not find anything. Here's an example of what I want to perform: original... (10 Replies)
Discussion started by: sramirez
10 Replies

6. Shell Programming and Scripting

convert data into matrix- awk

is it possible to count the number of keys based on state and cell and output it as a simple matrix. Ex: cell1-state1 has 2 keys cell3-state1 has 4 keys. Note: Insert 0 if no data available. input key states cell key1 state1 cell1 key1 state2 cell1 key1 ... (21 Replies)
Discussion started by: quincyjones
21 Replies

7. Shell Programming and Scripting

Reformatting data in matrix form

Hi, Some assistance with respect to the following problem will be very helpful. I want to reformat my dataset in the following manner for subsequent analysis. I have first column values (which repeat for each value of 2nd column) which are names, the second column specifies position ad the... (1 Reply)
Discussion started by: newbie83
1 Replies

8. UNIX for Dummies Questions & Answers

Convert nxm Matrix into columns of data

Dear Unixers, I'm having some difficulty in converting an n x m data matrix into a dataset of 3 columns and nxm rows. As an example I want to convert this dataset 2 3 4 5 2 0.0 0.0 0.1 0.1 6 -0.3 2.0 0.0 0.3 7 -0.6 -1.1 0.5 0.3 9 -0.9 -4.1 -0.7 0.5 ... (2 Replies)
Discussion started by: tintin72
2 Replies

9. Shell Programming and Scripting

[Solved] Converting the data into matrix with 0's and 1's

I have a file that contains 2 columns tag,pos cat input_file tag pos atg 10 ata 16 agt 15 agg 19 atg 17 agg 14 I have used following command to sort the file based on second column sort -k 2 input_file tag pos atg 10 agg 14 agt 15 ata 16 agg 19 atg 17 (2 Replies)
Discussion started by: raj_k
2 Replies

10. 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
GLPUSHMATRIX(3G)														  GLPUSHMATRIX(3G)

NAME
glPushMatrix, glPopMatrix - push and pop the current matrix stack C SPECIFICATION
void glPushMatrix( void ) C SPECIFICATION
void glPopMatrix( void ) DESCRIPTION
There is a stack of matrices for each of the matrix modes. In GL_MODELVIEW mode, the stack depth is at least 32. In the other modes, GL_COLOR, const(PROJECTION), and GL_TEXTURE, the depth is at least 2. The current matrix in any mode is the matrix on the top of the stack for that mode. glPushMatrix pushes the current matrix stack down by one, duplicating the current matrix. That is, after a glPushMatrix call, the matrix on top of the stack is identical to the one below it. glPopMatrix pops the current matrix stack, replacing the current matrix with the one below it on the stack. Initially, each of the stacks contains one matrix, an identity matrix. It is an error to push a full matrix stack, or to pop a matrix stack that contains only a single matrix. In either case, the error flag is set and no other change is made to GL state. ERRORS
GL_STACK_OVERFLOW is generated if glPushMatrix is called while the current matrix stack is full. GL_STACK_UNDERFLOW is generated if glPopMatrix is called while the current matrix stack contains only a single matrix. GL_INVALID_OPERATION is generated if glPushMatrix or glPopMatrix is executed between the execution of glBegin and the corresponding execu- tion of glEnd. ASSOCIATED GETS
glGet with argument GL_MATRIX_MODE glGet with argument GL_COLOR_MATRIX glGet with argument GL_MODELVIEW_MATRIX glGet with argument GL_PROJECTION_MATRIX glGet with argument GL_TEXTURE_MATRIX glGet with argument GL_COLOR_STACK_DEPTH glGet with argument GL_MODELVIEW_STACK_DEPTH glGet with argument GL_PROJECTION_STACK_DEPTH glGet with argument GL_TEXTURE_STACK_DEPTH glGet with argument GL_MAX_MODELVIEW_STACK_DEPTH glGet with argument GL_MAX_PROJECTION_STACK_DEPTH glGet with argument GL_MAX_TEXTURE_STACK_DEPTH SEE ALSO
glFrustum(3G), glLoadIdentity(3G), glLoadMatrix(3G), glMatrixMode(3G), glMultMatrix(3G), glOrtho(3G), glRotate(3G), glScale(3G), glTranslate(3G), glViewport(3G) GLPUSHMATRIX(3G)
All times are GMT -4. The time now is 03:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy