Sponsored Content
Top Forums Shell Programming and Scripting Help for a Perl newcomer! Transposing data from columns to rows Post 302577554 by Sarah_W on Tuesday 29th of November 2011 10:31:40 AM
Old 11-29-2011
As in this is the output i get:
Code:
subjects AF3_Li..nce AF4_Li..nce AF7_Li..nce AF8_Li..nce C1_Lin..nce C2_Lin..nce C3_Lin..nce C4_Lin..nce C5_Lin..nce C6_Lin..nce CP1_Li..nce CP2_Li..nce CP3_Li..nce CP4_Li..nce CP5_Li..nce CP6_Li..nce CPz_Li..nce Cz_Lin..nce F1_Lin..nce F2_Lin..nce F3_Lin..nce F4_Lin..nce F5_Lin..nce F6_Lin..nce F7_Lin..nce F8_Lin..nce FC1_Li..nce FC2_Li..nce FC3_Li..nce FC4_Li..nce FC5_Li..nce FC6_Li..nce FCz_Li..nce FT7_Li..nce FT8_Li..nce Fp1_Li..nce Fp2_Li..nce Fpz_Li..nce Fz_Lin..nce HEOG_L..nce M1_Lin..nce M2_Lin..nce O1_Lin..nce O2_Lin..nce Oz_Lin..nce P1_Lin..nce P2_Lin..nce P3_Lin..nce P4_Lin..nce P5_Lin..nce P6_Lin..nce P7_Lin..nce P8_Lin..nce PO3_Li..nce PO4_Li..nce PO5_Li..nce PO6_Li..nce PO7_Li..nce PO8_Li..nce POz_Li..nce Pz_Lin..nce T7_Lin..nce T8_Lin..nce TP7_Li..nce TP8_Li..nce VEOG_L..nce
   4.0749   7.7563          2.1861      S1 11.2153   PurNegForg   12.0973     12.2897       1.0983         6.4911   3.7960   10.4519  11.9439     2.0849

nothing alligned, nothing arranged by subject, the conditions are not specified by the items at the top, it just comes out a random arrangement like above..

It needs to be arranged by condition and item on the top row, with each subject only having one row.

Any help with this is greatly appreciated!

Last edited by Franklin52; 12-03-2011 at 11:37 AM.. Reason: Please use code tags for data and code samples, thank you
 

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

Data in Rows to Columns

Hi, I am a beginner in bash&perl. I have data in form of:- A 1 B 2 C 3 D 4 E 5 I would like your help to find a simple way to change it to :- A B C D E 1 2 3 4 5 Any help would be highly appreciated. (8 Replies)
Discussion started by: umaars
8 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. UNIX for Dummies Questions & Answers

Suggestion to convert data in rows to data in columns

Hello everyone! I have a huge dataset looking like this: nameX nameX 0 1 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 1 2 2 2 ............... nameY nameY 2 2 2 2 2 2 2 2 2 2 1 2 2 2 1 2 2 2 ..... nameB nameB 0 1 2 2 2 2 2 2 2 2 1 2 2 2 1 2 2 2 ..... (can be several thousands of codes) and I need... (8 Replies)
Discussion started by: kush
8 Replies

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

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

7. Shell Programming and Scripting

Transpose Data from Columns to rows

Hello. very new to shell scripting and would like to know if anyone could help me. I have data thats being pulled into a txt file and currently have to manually transpose the data which is taking a long time to do. here is what the data looks like. Server1 -- Date -- Other -- value... (7 Replies)
Discussion started by: Mikes88
7 Replies

8. Shell Programming and Scripting

transposing columns into rows

Hi, I need to transpose columns of my files into rows and save it as individual files. sample contents of the file below. 0.9120 0.7782 0.6959 0.6904 0.6322 0.8068 0.9082 0.9290 0.7272 0.9870 0.7648 0.8053 0.8300 0.9520 0.8614 0.6734 0.7910 0.6413 0.7126 0.7364 0.8491 0.8868 0.7586 0.8949... (8 Replies)
Discussion started by: ida1215
8 Replies

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

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
NSDB-CREATE-FSN(8)					      System Manager's Manual						NSDB-CREATE-FSN(8)

NAME
nsdb-create-fsn - create a fileset name (FSN) record on an NSDB SYNOPSIS
nsdb-create-fsn [-?d] [-D binddn] [-e nce] [-l nsdbname] [-r nsdbport] [-t ttl] fsn-uuid INTRODUCTION
RFC 5716 introduces the Federated File System (FedFS, for short). FedFS is an extensible standardized mechanism by which system adminis- trators construct a coherent namespace across multiple file servers using file system referrals. For further details, see fedfs(7). The bulk of FedFS junction information in a FedFS domain is stored on one or more LDAP servers. These servers are known as namespace data- bases, or NSDBs, for short. FedFS-enabled file servers and clients access the information stored on NSDBs via standard LDAP queries. FedFS-enabled file servers use these queries to resolve FedFS junctions. FedFS administrators use them to manage information about file sets contained in a FedFS domain name space. DESCRIPTION
The nsdb-create-fsn(8) command is part of a collection of low-level single-use programs that is intended for testing the NSDB protocol or for use in scripts. It creates a FedFS fileset name (FSN) record on an NSDB. A fileset name, or FSN, uniquely identifies a fileset in FedFS. An FSN consists of a UUID and the hostname and port of an NSDB. This pair is intended to be unique across all of FedFS. The meaning of these items is described in more detail in fedfs(7). A FedFS junction contains an FSN. There can be multiple junctions that contain a particular FSN. There is exactly one FSN record stored on an NSDB that corresponds to this FSN. The FSN record can have zero or more FSL records as children. Replicas of these records can exist on more than one LDAP server. The nsdb-create-fsn(8) command creates an FSN record on the named NSDB in preparation for use in FedFS junctions. It does not create FedFS junctions. To create a junction, use the fedfs-create-junction(8) command. It does not create any FSL children records. To create an FSL record, use the nsdb-create-fsl(8) command. This command has one positional parameter which specifies the UUID of the new FSN record. OPTIONS
-d, --debug Enables debugging messages during operation. -?, --help Displays nsdb-create-fsn(8) version information and a usage message on stderr. -D, --binddn=bind-distinguished-name Specifies a distinguished name of an entity used to bind to the LDAP server where the NSDB resides. If the --binddn option is not specified, the value of the FEDFS_NSDB_ADMIN environment variable is consulted. If this variable is not set, the NSDB connection parameter database is searched for this DN. If none of these is specified, or if this entity does not have permission to modify this area of the server's DIT, the nsdb-create-fsn(8) command fails. -e, --nce=NSDB-container-entry-distinguished-name Specifies the distinguished name of the NSDB Container Entry under which this FSN record is to be created. If the --nce option is not specified, the value of the FEDFS_NSDB_NCE environment variable is consulted. If this variable is not set, then the NSDB con- nection parameter database is searched for this DN. If none of these is specified, the nsdb-create-fsn(8) command fails. -l, --nsdbname=NSDB-host-name Specifies the hostname of the NSDB where the new FSN record should reside. If the --nsdbname option is not specified, the value of the FEDFS_NSDB_HOST environment variable is consulted. If the variable is not set and the --nsdbname option is not specified, the nsdb-create-fsn(8) command fails. -r, --nsdbport=NSDB-port Specifies the IP port of the NSDB where the new FSN record should reside. If the --nsdbport option is not specified, the value of the FEDFS_NSDB_PORT environment variable is consulted. The default value if the variable is not set is 389. -t, --ttl=TTL Specifies the number of seconds a file server may cache the information in this record. If the --ttl option is not specified, a value of 300 seconds is used. EXIT CODES
The NSDB returns a value that reflects the success of the requested operation. FEDFS_OK The LDAP modify request succeeded. FEDFS_ERR_ACCESS The bound entity does not have permission to perform the requested operation. FEDFS_ERR_INVAL One of the arguments was not valid. FEDFS_ERR_SVRFAULT An unanticipated non-protocol error occurred. FEDFS_ERR_NSDB_ROUTE The nsdb-create-fsn(8) command was unable to find a route to the specified NSDB. FEDFS_ERR_NSDB_DOWN The nsdb-create-fsn(8) command determined that the specified NSDB was down. FEDFS_ERR_NSDB_CONN The nsdb-create-fsn(8) command was unable to establish a connection with the specified NSDB. FEDFS_ERR_NSDB_AUTH The nsdb-create-fsn(8) command was unable to authenticate and establish a secure connection with the specified NSDB. FEDFS_ERR_NSDB_LDAP A non-specific LDAP error occurred on the connection between the nsdb-create-fsn(8) command and specified NSDB. FEDFS_ERR_NSDB_LDAP_VAL An LDAP error occurred on the connection between the nsdb-create-fsn(8) command and specified NSDB. The specific error may be dis- played on the command line. FEDFS_ERR_NSDB_NONCE The nsdb-create-fsn(8) command was unable to locate the NCE on the specified NSDB. FEDFS_ERR_NSDB_NOFSN The nsdb-create-fsn(8) command was unable to locate the specified FSN on the specified NSDB. FEDFS_ERR_NSDB_RESPONSE The nsdb-create-fsn(8) command received a malformed response from the specified NSDB. FEDFS_ERR_NSDB_FAULT An unanticipated error related to the specified NSDB occurred. FEDFS_ERR_NSDB_PARAMS The local NSDB connection parameter database does not have any connection parameters on record for the specified NSDB. FEDFS_ERR_NSDB_LDAP_REFERRAL The nsdb-create-fsn(8) command received an LDAP referral that it was unable to follow. FEDFS_ERR_NSDB_LDAP_REFERRAL_VAL The nsdb-create-fsn(8) command received an LDAP referral that it was unable to follow. A specific error may be displayed on the command line. FEDFS_ERR_NSDB_LDAP_REFERRAL_NOTFOLLOWED The nsdb-create-fsn(8) command received an LDAP referral that it chose not to follow, either because the local implementation does not support following LDAP referrals or LDAP referral following is disabled. FEDFS_ERR_NSDB_PARAMS_LDAP_REFERRAL The nsdb-create-fsn(8) command received an LDAP referral that it chose not to follow because the local NSDB connection parameter database had no connection parameters for the NSDB targeted by the LDAP referral. EXAMPLES
Suppose you are the FedFS administrator of the example.net FedFS domain and that you have created a new FSN for some fileset. The new FSN might look like: FSN UUID: 8e246ddc-7b46-11e0-8252-000c297fd679 NSDB: nsdb.example.net:389 Further suppose the NSDB nsdb.example.net:389 has an NSDB Container Entry whose distinguished name is o=fedfs. To create a corresponding FSN record, you might use: $ nsdb-create-fsn -D cn=Manager -e o=fedfs -l nsdb.example.net 8e246ddc-7b46-11e0-8252-000c297fd679 Enter NSDB password: Successfully created FSN record fedfsFsnUuid=8e246ddc-7b46-11e0-8252-000c297fd679,o=fedfs A new FSN record is created on nsdb.example.net:389 with a distinguished name of fedfsFsnUuid=8e246ddc-7b46-11e0-8252-000c297fd679,o=fedfs. To see the new FSN record, use nsdb-list(8) or nsdb-resolve-fsn(8). SECURITY
Permission to modify the LDAP's DIT is required to create a new FSN record. The nsdb-create-fsn(8) command must bind as an entity permit- ted to modify the DIT to perform this operation. The nsdb-create-fsn(8) command asks for a password on stdin. Standard password blanking techniques are used to obscure the password on the user's terminal. The target LDAP server must be registered in the local NSDB connection parameter database. The connection security mode listed in the NSDB connection parameter database for the target LDAP server is used during this operation. See nsdbparams(8) for details on how to register an NSDB in the local NSDB connection parameter database. SEE ALSO
fedfs(7), fedfs-create-junction(8), nsdb-create-fsl(8), nsdb-resolve-fsn(8), nsdb-list(8), nsdbparams(8) RFC 5716 for FedFS requirements and overview RFC 4510 for an introduction to LDAP COLOPHON
This page is part of the fedfs-utils package. A description of the project and information about reporting bugs can be found at http://wiki.linux-nfs.org/wiki/index.php/FedFsUtilsProject. AUTHOR
Chuck Lever <chuck.lever@oracle.com> 3 February 2014 NSDB-CREATE-FSN(8)
All times are GMT -4. The time now is 06:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy