Sponsored Content
Top Forums Shell Programming and Scripting Help converting row data to columns Post 302451926 by bartus11 on Wednesday 8th of September 2010 02:16:52 PM
Old 09-08-2010
Perl:
Code:
 perl -F':' -alne 'BEGIN{print "First Name Last Name DOB POB"};if ($. % 4){$s.=$F[1]}else{$s=~s/^ //;print $s.$F[1];$s=""}' file

AWK:
Code:
awk -F": " -vORS="" 'BEGIN{print "First Name Last Name DOB POB\n"}NR%4{print $2" ";next}{print "\n"}' file

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting tables of row data into columns of tables

I am trying to transpose tables listed in the format into format. Any help would be greatly appreciated. Input: test_data_1 1 2 90% 4 3 91% 5 4 90% 6 5 90% 9 6 90% test_data_2 3 5 92% 5 4 92% 7 3 93% 9 2 92% 1 1 92% ... Output:... (7 Replies)
Discussion started by: justthisguy
7 Replies

2. Shell Programming and Scripting

How to insert data befor some field in a row of data depending up on values in row

Hi I need to do some thing like "find and insert before that " in a file which contains many records. This will be clear with the following example. The original data record should be some thing like this 60119827 RTMS_LOCATION_CDR INSTANT_POSITION_QUERY 1236574686123083rtmssrv7 ... (8 Replies)
Discussion started by: aemunathan
8 Replies

3. Shell Programming and Scripting

How to convert 2 column data into multiple columns based on a keyword in a row??

Hi Friends I have the following input data in 2 columns. SNo 1 I1 Value I2 Value I3 Value SNo 2 I4 Value I5 Value I6 Value I7 Value SNo 3 I8 Value I9 Value ............... ................ SNo N (1 Reply)
Discussion started by: ks_reddy
1 Replies

4. Shell Programming and Scripting

Splitting data from one row as multiple columns

Hi I have a file containing some data as follows: 11-17-2010:13:26 64 4 516414 1392258 11-17-2010:13:26 128 4 586868 695603 11-17-2010:13:26 256 4 474937 1642294 11-17-2010:13:32 64 4 378715 1357066 11-17-2010:13:32 128 4 597981 1684006 ... (17 Replies)
Discussion started by: annazpereira
17 Replies

5. Shell Programming and Scripting

Format row data into columns

I have a file which looks like this: /* ----------------- EDW$MOC139_R_NNA_BR_SUM_FACT2 ----------------- */ insert_job: EDW$MOC139_R_NNA_BR_SUM_FACT2 job_type: c command: /home/btchproc/load_process/batch_files/batch_nna_brn_split_sum_fact2.sh m machine: edwprod02.dsm.pwj.com #owner:... (29 Replies)
Discussion started by: Gangadhar Reddy
29 Replies

6. Shell Programming and Scripting

converting column to row

Hi everyone.. I have a list of values in a file... 1.2345e-1 2.282828e+ 3.2341e-1 1.1223445e-1 I am interested in converting this column to a row.. 1.2345e-1 2.282828e+ 3.2341e-1 1.1223445e-1 can anyone pls help?? I am a liunx newbie.. Thanks.. (7 Replies)
Discussion started by: kjha
7 Replies

7. 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

8. Emergency UNIX and Linux Support

[Solved] Mysql - Take data from row and copy it to another row

Sorry if I repost my question in this section, but I'm really in a hurry since I have to finish my work... :( Dear community, I have a table with two rows like: Row1 Row2 ======= ======= 7,3 text 1 1,3 text 2 1,2,3 blabla What i need to do is add/copy... (2 Replies)
Discussion started by: Lord Spectre
2 Replies

9. Shell Programming and Scripting

Converting data from specific columns

i have a file (csv or txt or anything which has 4 columns (id,name,number,location) and it contains data. i want to convert the data of specific columns like name to ooooo and number to 88888 matching the field length of that columns. for example if name column has anthony which is 7, it should... (2 Replies)
Discussion started by: prajaktaraut
2 Replies
MPSMatrixDecompositionLU(3)				 MetalPerformanceShaders.framework			       MPSMatrixDecompositionLU(3)

NAME
MPSMatrixDecompositionLU SYNOPSIS
#import <MPSMatrixDecomposition.h> Inherits MPSMatrixUnaryKernel. Instance Methods (nonnull instancetype) - initWithDevice:rows:columns: (void) - encodeToCommandBuffer:sourceMatrix:resultMatrix:pivotIndices:status: Additional Inherited Members Detailed Description This depends on Metal.framework. A kernel for computing the LU factorization of a matrix using partial pivoting with row interchanges. A MPSMatrixDecompositionLU object computes an LU factorization: P * A = L * U A is a matrix for which the LU factorization is to be computed. L is a unit lower triangular matrix and U is an upper triangular matrix. P is a permutation matrix. Method Documentation - (void) encodeToCommandBuffer: (nonnull id< MTLCommandBuffer >) commandBuffer(MPSMatrix *__nonnull) sourceMatrix(MPSMatrix *__nonnull) resultMatrix(MPSMatrix *__nonnull) pivotIndices(__nullable id< MTLBuffer >) status Encode a MPSMatrixDecompositionLU kernel into a command Buffer. Parameters: commandBuffer A valid MTLCommandBuffer to receive the encoded filter sourceMatrix A valid MPSMatrix containing the source data. Must have enough space to hold a rows x columns matrix. resultMatrix A valid MPSMatrix to contain the result. Must have enough space to hold a rows x columns matrix. pivotIndices A valid MPSMatrix to contain the pivot indices. Must have enough space to hold an array of size 1xmin(rows, columns) values. Element type must be MPSDataTypeUInt32. status A MTLBuffer which indicates the resulting MPSMatrixDecompositionStatus value. This function encodes the MPSMatrixDecompositionLU object to a valid command buffer. Upon completion the array pivotIndices contains, for each index i, the row interchanged with row i. If during the computation U[k, k], for some k, is determined to be exactly zero MPSMatrixDecompositionStatusSingular will be returned in the provided status buffer. The data referenced by the MTLBuffer is not valid until the command buffer has completed execution. If the matrix return status is not desired NULL may be provided. Upon successful factorization, resultMatrix contains the resulting lower triangular factor (without the unit diagonal elements) in its strictly lower triangular region and the upper triangular factor in its upper triangular region. This kernel functions either in-place, if the result matrix completely aliases the source matrix, or out-of-place. If there is any partial overlap between input and output data the results are undefined. - (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) device(NSUInteger) rows(NSUInteger) columns Initialize an MPSMatrixDecompositionLU object on a device Parameters: device The device on which the kernel will execute. rows The number of rows in the source matrix. columns The number of columns in the source matrix. Returns: A valid MPSMatrixDecompositionLU object or nil, if failure. Author Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code. Version MetalPerformanceShaders-100 Thu Feb 8 2018 MPSMatrixDecompositionLU(3)
All times are GMT -4. The time now is 05:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy