Sponsored Content
Top Forums Shell Programming and Scripting transposing columns into rows Post 302595682 by Scrutinizer on Saturday 4th of February 2012 02:33:58 AM
Old 02-04-2012
Try:
Code:
awk '{f="outfile"NR;$1=$1;print>f;close(f)}' OFS="\n" infile


Last edited by Scrutinizer; 02-04-2012 at 03:44 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Rows to columns transposing and reformating.

----File attached. Input file =========== COL_1 <IP Add 1> COL_2 <Service1> COL_3 <ABCDEFG> COL_4 <IP ADD:PORT> COL_4 <IP ADD:PORT> COL_1 <IP Add 2> COL_2 <Service2> COL_2 <Service3> COL_2 <Service4> COL_3 <AAAABBB> COL_4 <IP ADD:PORT> COL_4 <IP ADD:PORT> COL_4 <IP... (27 Replies)
Discussion started by: bluethunder
27 Replies

2. Shell Programming and Scripting

Transposing columns with awk

I want a sweet simple time efficient awk script in online which gets output 001_r 0.0265185 0.0437049 0.0240642 0.0310264 0.0200482 0.0146746 0.0351344 0.0347856 0.036119 1.49 firstcoloumnvalue allvaluesof 'c' in one row 001_r : 002_r c: 0.0265185 N: 548 001_r : 007_r c:... (5 Replies)
Discussion started by: phoenix_nebula
5 Replies

3. Shell Programming and Scripting

Transposing rows into columns

I have a file like the one given below P1|V1|V2 P1|V1|V3 P1V1|V2 P2|V1|V4 P2|V2|V6 P2|V1|V4 I want it convert to P1|V1|V2|V2|V3 P2|V1|V4|V2|V6 2nd and 3rd column should be considered as together and so the tird row is duplicate Any ideas? (3 Replies)
Discussion started by: prasperl
3 Replies

4. Shell Programming and Scripting

awk, string as record separator, transposing rows into columns

I'm working on a different stage of a project that someone helped me address elsewhere in these threads. The .docs I'm cycling through look roughly like this: 1 of 26 DOCUMENTS Copyright 2010 The Age Company Limited All Rights Reserved The Age (Melbourne, Australia) November 27, 2010... (9 Replies)
Discussion started by: spindoctor
9 Replies

5. Shell Programming and Scripting

Transposing Repeated Rows to Columns.

I have 1000s of these rows that I would like to transpose to columns. However I would like the transpose every 3 consecutive rows to columns like below, sorted by column 3 and provide a total for each occurrences. Finally I would like a grand total of column 3. 21|FE|41|0B 50\65\78 15... (2 Replies)
Discussion started by: ravzter
2 Replies

6. Shell Programming and Scripting

Help for a Perl newcomer! Transposing data from columns to rows

I have to create a Perl script which will transpose the data output from my experiment, from columns to rows, in order for me to analyse the data. I am a complete Perl novice so any help would be greatly appreciated. The data as it stands looks like this: Subject Condition Fp1 ... (12 Replies)
Discussion started by: Sarah_W
12 Replies

7. Shell Programming and Scripting

Transposing rows and columns (pivoting) using shell scripting

Here is the contents of an input file. A,1,2,3,4 10,aaa,bbb,ccc,ddd 11,eee,fff,ggg,hhh 12,iii,jjj,lll,mmm 13,nnn,ooo,ppp I wanted the output to be A 10 1 aaa 10 2 bbb 10 3 ccc 10 4 ddd 11 1 eee 11 2 fff 11 3 ggg 11 4 hhh ..... and so on How to do it in ksh... (9 Replies)
Discussion started by: ksatish89
9 Replies

8. Shell Programming and Scripting

transposing lines to columns

Okay folks, here's a question. I tried searching but couldn't find exactly what I needed. I have a text file (excerpt below). This text file is an extract I did from several hundred pages of datasheets using grep so I could look only at the site history for each site. The problem is that... (2 Replies)
Discussion started by: jbrandt1979
2 Replies

9. Shell Programming and Scripting

Awk/sed script for transposing any number of rows with header row

Greetings! I have been trying to find out a way to take a CSV file with a large number of rows, and a very large number of columns (in the thousands) and convert the rows to a single column of data, where the first row is a header representing the attribute name and the subsequent series of... (3 Replies)
Discussion started by: tntelle
3 Replies

10. Shell Programming and Scripting

Transposing rows to columns with multiple similar lines

Hi, I am trying to transpose rows to columns for thousands of records. The problem is there are records that have the same lines that need to be separated. the input file as below:- ID 1A02_HUMAN AC P01892; O19619; P06338; P10313; P30444; P30445; P30446; P30514; AC Q29680; Q29837;... (2 Replies)
Discussion started by: redse171
2 Replies
MPSMatrixVectorMultiplication(3)			 MetalPerformanceShaders.framework			  MPSMatrixVectorMultiplication(3)

NAME
MPSMatrixVectorMultiplication SYNOPSIS
#import <MPSMatrixMultiplication.h> Inherits MPSMatrixBinaryKernel. Instance Methods (nonnull instancetype) - initWithDevice:transpose:rows:columns:alpha:beta: (nonnull instancetype) - initWithDevice:rows:columns: (nonnull instancetype) - initWithDevice: (void) - encodeToCommandBuffer:inputMatrix:inputVector:resultVector: Additional Inherited Members Detailed Description This depends on Metal.framework. A matrix-vector multiplication kernel. A MPSMatrixVectorMultiplication object computes: y = alpha * op(A) * x + beta * y A is a matrix represented by a MPSMatrix object. alpha and beta are scalar values (of the same data type as values of y) which are applied as shown above. A may have an optional transposition operation applied. A MPSMatrixVectorMultiplication object is initialized with the transpose operator to apply to A, sizes for the operation to perform, and the scalar values alpha and beta. Method Documentation - (void) encodeToCommandBuffer: (nonnull id< MTLCommandBuffer >) commandBuffer(MPSMatrix *__nonnull) inputMatrix(MPSVector *__nonnull) inputVector(MPSVector *__nonnull) resultVector Encode a MPSMatrixVectorMultiplication object to a command buffer. Parameters: commandBuffer A valid MTLCommandBuffer to receive the encoded kernel. inputMatrix A valid MPSMatrix object which specifies the input matrix A. inputVector A valid MPSVector object which specifies the input vector x. resultVector A valid MPSVector object which specifies the addend vector which will also be overwritten by the result. The left input matrix must be large enough to hold an array of size (rows x columns) elements beginning at primarySourceMatrixOrigin. The input vector must be large enough to hold an array of size (columns) elements beginning at secondarySourceMatrixOrigin.x secondarySourceMatrixOrigin.y and secondarySourceMatrixOrigin.z must be zero. The result vector must be large enough to hold an array of size (rows) elements beginning at resultMatrixOrigin.x. resultMatrixOrigin.y and resultMatrixOrigin.z must be zero. - (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) device Use the above initialization method instead. Reimplemented from MPSKernel. - (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) device(NSUInteger) rows(NSUInteger) columns Convenience initialization for a matrix-vector multiplication with no transposition, unit scaling of the product, and no accumulation of the result. The scaling factors alpha and beta are taken to be 1.0 and 0.0 respectively. Parameters: device The device on which the kernel will execute. rows The number of rows in the input matrix A, and the number of elements in the vector y. columns The number of columns in the input matrix A, and the number of elements in the input vector x. Returns: A valid MPSMatrixVectorMultiplication object or nil, if failure. - (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) device(BOOL) transpose(NSUInteger) rows(NSUInteger) columns(double) alpha(double) beta Initialize an MPSMatrixVectorMultiplication object on a device for a given size and desired transpose and scale values. Parameters: device The device on which the kernel will execute. transpose A boolean value which indicates if the input matrix should be used in transposed form. if 'YES' then op(A) == A**T, otherwise op(A) == A. rows The number of rows in the input matrix op(A), and the number of elements in the vector y. columns The number of columns in the input matrix op(A), and the number of elements in the input vector x. alpha The scale factor to apply to the product. Specified in double precision. Will be converted to the appropriate precision in the implementation subject to rounding and/or clamping as necessary. beta The scale factor to apply to the initial values of y. Specified in double precision. Will be converted to the appropriate precision in the implementation subject to rounding and/or clamping as necessary. Returns: A valid MPSMatrixVectorMultiplication object or nil, if failure. Author Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code. Version MetalPerformanceShaders-100 Thu Feb 8 2018 MPSMatrixVectorMultiplication(3)
All times are GMT -4. The time now is 02:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy