Sponsored Content
Top Forums Shell Programming and Scripting Transpose Data form Different form Post 302717267 by rdrtx1 on Wednesday 17th of October 2012 11:29:14 PM
Old 10-18-2012
also:
Code:
awk '{
   if ($1 in a) ao[ac++]=$1;
   a[$1]=$1;
   ++l[$1];
   cnt[$1]=NF - 1;
   for (i=2; i<=NF; i++) {
      arr[$1 (l[$1]) (i-1)]=$i;
   }
}
END {
  for (i=0; i<ac; i++) {
    for (j=1; j<=cnt[ao[i]]; j++) {
      printf("%s\t%s\t%s\n", ao[i], arr[ao[i] 1 j], arr[ao[i] 2 j]);
    }
  }
}' infile

This User Gave Thanks to rdrtx1 For This Post:
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Changing Unix form to Microsoft Word form to be able to email it to someone.

Please someone I need information on how to change a Unix form/document into a microsoft word document in order to be emailed to another company. Please help ASAP. Thankyou :confused: (8 Replies)
Discussion started by: Cheraunm
8 Replies

2. UNIX for Dummies Questions & Answers

data form

I am user Of linux 9.0 Operating System and I had data form unix Operating system and I am not abel to open it in linux 9.0 Please tell me how can i use unix data in linux . (3 Replies)
Discussion started by: harsh_guru
3 Replies

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

4. Shell Programming and Scripting

convert one form of xml data to other

I would like to convert one form of xml tag data to another <DescriptionList> <DescriptionExt language="en" shortDesc="ITALIAN SAUSAGE SUB" longDesc="" sizeDesc="" smallImage="Pictures\sub-italian-sausage.png" largeImage="" forceImageUpdate="yes" /> ... (1 Reply)
Discussion started by: saisus
1 Replies

5. UNIX and Linux Applications

Get the data in my required form using gawk

i had the data in the following form: Branch : 3379 As On : 31-JAN-2009 Page : 1 User Id : OPER1 Date & Time : 01-FEB-2009 04:02:37 ... (2 Replies)
Discussion started by: KANNI786
2 Replies

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

7. UNIX for Dummies Questions & Answers

Put data in tabular form..

Dear Friends, I have a file as under : +++ ME 12-06-13 18:16:20 A RED FEW AND ROW1 1MN FEL AS HI FI BV LR TS HR ES MR * 0 13296 0 120 1 15 KS RR 10 0 +++ ME 12-06-13 18:26:20 A RED FEW AND ROW2 1MN FEL AS... (2 Replies)
Discussion started by: vanand420
2 Replies

8. Shell Programming and Scripting

Remove x lines form top and y lines form bottom using AWK?

How to remove x lines form top and y lines form bottom. This works, but like awk only cat file | head -n-y | awk 'NR>(x-1)' so remove last 3 lines and 5 firstcat file | head -n-3 | awk 'NR>4' (5 Replies)
Discussion started by: Jotne
5 Replies

9. Shell Programming and Scripting

Getting data in table form

Hi, I have a csv file from which i am fetching few columns as below: IFILE=/home/home1/Report1.csv OFILE=/home/home1/`date +"%m%d%y%H%M%S"`.dat if #Checks if file exists and readable then awk -F "," '(NR>4) {print $1,$6,$2,$3,$4,$5,$6}' ${IFILE} >> ${OFILE} fi cat $OFILE | mail... (7 Replies)
Discussion started by: Vivekit82
7 Replies
slasq6.f(3)							      LAPACK							       slasq6.f(3)

NAME
slasq6.f - SYNOPSIS
Functions/Subroutines subroutine slasq6 (I0, N0, Z, PP, DMIN, DMIN1, DMIN2, DN, DNM1, DNM2) SLASQ6 computes one dqd transform in ping-pong form. Used by sbdsqr and sstegr. Function/Subroutine Documentation subroutine slasq6 (integerI0, integerN0, real, dimension( * )Z, integerPP, realDMIN, realDMIN1, realDMIN2, realDN, realDNM1, realDNM2) SLASQ6 computes one dqd transform in ping-pong form. Used by sbdsqr and sstegr. Purpose: SLASQ6 computes one dqd (shift equal to zero) transform in ping-pong form, with protection against underflow and overflow. Parameters: I0 I0 is INTEGER First index. N0 N0 is INTEGER Last index. Z Z is REAL array, dimension ( 4*N ) Z holds the qd array. EMIN is stored in Z(4*N0) to avoid an extra argument. PP PP is INTEGER PP=0 for ping, PP=1 for pong. DMIN DMIN is REAL Minimum value of d. DMIN1 DMIN1 is REAL Minimum value of d, excluding D( N0 ). DMIN2 DMIN2 is REAL Minimum value of d, excluding D( N0 ) and D( N0-1 ). DN DN is REAL d(N0), the last value of d. DNM1 DNM1 is REAL d(N0-1). DNM2 DNM2 is REAL d(N0-2). Author: Univ. of Tennessee Univ. of California Berkeley Univ. of Colorado Denver NAG Ltd. Date: September 2012 Definition at line 119 of file slasq6.f. Author Generated automatically by Doxygen for LAPACK from the source code. Version 3.4.2 Tue Sep 25 2012 slasq6.f(3)
All times are GMT -4. The time now is 03:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy