Sponsored Content
Top Forums Shell Programming and Scripting Convert columns to row using awk Post 302756079 by Jotne on Tuesday 15th of January 2013 06:55:43 AM
Old 01-15-2013
Works fine, thanks Smilie
It will take me some time to understand how this works...
 

8 More Discussions You Might Find Interesting

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

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

3. Shell Programming and Scripting

Convert columns to single row

Hello all I have data like 1 2 3 4 5 I wish my output would be like 1,2,3,4,5 For this i have executed 'BEGIN {FS="\n"; ORS=","} {print $0}' test and got the output as 1,2,3,4,5, I do not want to have , at the end of 5. output should be like (5 Replies)
Discussion started by: vasuarjula
5 Replies

4. Shell Programming and Scripting

By using AWK can I convert matrice shaped data to a row ?

Hello, I have output in the matrice form , for example: 1 2 3 4 a b c d jim joe sue tom how can I convert this line-column data into a row as follows 1 2 3 4 a b c d jim joe sue tom thank you (14 Replies)
Discussion started by: rpf
14 Replies

5. Shell Programming and Scripting

awk print specific columns one row at a time

Hello, I have the following piece of code: roleName =`cat $inputFile | awk -F';' '{ print $1 }'` roleDescription =`cat $inputFile | awk -F';' '{ print $2 }'` roleAuthProfile =`cat $inputFile | awk -F';' '{ print $3 }'` mappedUserID (5 Replies)
Discussion started by: pr0tocoldan
5 Replies

6. UNIX for Dummies Questions & Answers

awk: convert column to row in a specific way

Hi all! I have this kind of output: a1|b1|c1|d1|e1 a2|b2|c2 a3|b3|c3|d3 I would like to transpose columns d and e (when they exist) in column c, and under the row where they come from. Then copying the beginning of the row. In order to obtain: a1|b1|c1 a1|b1|d1 a1|b1|e1 a2|b2|c2... (1 Reply)
Discussion started by: lucasvs
1 Replies

7. Shell Programming and Scripting

Convert row to columns start from nth column

Dear All, We have input like this: 161 57 1378 176 1392 262 1444 441 1548 538 1611 670 1684 241 57 1378 208 1393 269 1447 444 1549 538 1610 677 1700 321 ... (4 Replies)
Discussion started by: attila
4 Replies

8. Shell Programming and Scripting

awk split columns to row after N number of column

I want to split this with every 5 or 50 depend on how much data the file will have. And remove the comma on the end Source file will have 001,0002,0003,004,005,0006,0007,007A,007B,007C,007E,007F,008A,008C Need Output from every 5 tab and remove the comma from end of each row ... (4 Replies)
Discussion started by: ranjancom2000
4 Replies
Math(3) 						User Contributed Perl Documentation						   Math(3)

NAME
PDL::Math - extended mathematical operations and special functions SYNOPSIS
use PDL::Math; use PDL::Graphics::TriD; imag3d [SURF2D,bessj0(rvals(zeroes(50,50))/2)]; DESCRIPTION
This module extends PDL with more advanced mathematical functions than provided by standard Perl. All the functions have one input pdl, and one output, unless otherwise stated. Many of the functions are linked from the system maths library or the Cephes maths library (determined when PDL is compiled); a few are implemented entirely in PDL. FUNCTIONS
acos Signature: (a(); [o]b()) The usual trigonometric function. Works inplace. acos does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. asin Signature: (a(); [o]b()) The usual trigonometric function. Works inplace. asin does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. atan Signature: (a(); [o]b()) The usual trigonometric function. Works inplace. atan does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. cosh Signature: (a(); [o]b()) The standard hyperbolic function. Works inplace. cosh does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. sinh Signature: (a(); [o]b()) The standard hyperbolic function. Works inplace. sinh does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. tan Signature: (a(); [o]b()) The usual trigonometric function. Works inplace. tan does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. tanh Signature: (a(); [o]b()) The standard hyperbolic function. Works inplace. tanh does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. ceil Signature: (a(); [o]b()) Round to integral values in floating-point format. Works inplace. ceil does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. floor Signature: (a(); [o]b()) Round to integral values in floating-point format. Works inplace. floor does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. rint Signature: (a(); [o]b()) Round to integral values in floating-point format. Works inplace. rint does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. pow Signature: (a(); b(); [o]c()) Synonym for `**'. Works inplace. pow does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. acosh Signature: (a(); [o]b()) The standard hyperbolic function. Works inplace. acosh does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. asinh Signature: (a(); [o]b()) The standard hyperbolic function. Works inplace. asinh does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. atanh Signature: (a(); [o]b()) The standard hyperbolic function. Works inplace. atanh does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. erf Signature: (a(); [o]b()) The error function. Works inplace. erf does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. erfc Signature: (a(); [o]b()) The complement of the error function. Works inplace. erfc does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. bessj0 Signature: (a(); [o]b()) The standard Bessel function. Works inplace. bessj0 does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. bessj1 Signature: (a(); [o]b()) The standard Bessel function. Works inplace. bessj1 does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. bessy0 Signature: (a(); [o]b()) The standard Bessel function. Works inplace. bessy0 does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. bessy1 Signature: (a(); [o]b()) The standard Bessel function. Works inplace. bessy1 does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. bessjn Signature: (a(); int n(); [o]b()) The standard Bessel function. This has a second integer argument which gives the order of the function required. Works inplace. bessjn does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. bessyn Signature: (a(); int n(); [o]b()) The standard Bessel function. This has a second integer argument which gives the order of the function required. Works inplace. bessyn does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. lgamma Signature: (a(); [o]b(); int[o]s()) log gamma function This returns 2 piddles -- the first set gives the log(gamma) values, while the second set, of integer values, gives the sign of the gamma function. This is useful for determining factorials, amongst other things. lgamma does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. badmask Signature: (a(); b(); [o]c()) Clears all "infs" and "nans" in $a to the corresponding value in $b. badmask can be run with $a inplace: badmask($a->inplace,0); $a->inplace->badmask(0); If bad values are present, these are also cleared. isfinite Signature: (a(); int [o]mask()) Sets $mask true if $a is not a "NaN" or "inf" (either positive or negative). Works inplace. Bad values are treated as "NaN" or "inf". erfi Signature: (a(); [o]b()) The inverse of the error function. Works inplace. erfi does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. ndtri Signature: (a(); [o]b()) The value for which the area under the Gaussian probability density function (integrated from minus infinity) is equal to the argument (cf erfi). Works inplace. ndtri does handle bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. polyroots Signature: (cr(n); ci(n); [o]rr(m); [o]ri(m)) Complex roots of a complex polynomial, given coefficients in order of decreasing powers. ($rr, $ri) = polyroots($cr, $ci); polyroots does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. BUGS
Hasn't been tested on all platforms to ensure Cephes versions are picked up automatically and used correctly. AUTHOR
Copyright (C) R.J.R. Williams 1997 (rjrw@ast.leeds.ac.uk), Karl Glazebrook (kgb@aaoepp.aao.gov.au) and Tuomas J. Lukka (Tuomas.Lukka@helsinki.fi). Portions (C) Craig DeForest 2002 (deforest@boulder.swri.edu). All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the PDL copyright notice should be included in the file. perl v5.12.1 2010-07-05 Math(3)
All times are GMT -4. The time now is 02:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy