Sponsored Content
Top Forums Shell Programming and Scripting Help for a Perl newcomer! Transposing data from columns to rows Post 302578003 by Sarah_W on Wednesday 30th of November 2011 01:09:32 PM
Old 11-30-2011
Thank you, that one does work a lot better!

I think the issue is that the way my raw data has been exported, it is not properly alligned in collumns itself, so when i run the script it does not have properly alligned data to work with in the first place!

I dont suppose you know of any scripts that could allign my raw data first, before running the script?

Currently my raw data, has all the items along the top, but the numbers underneath are not fitting perfectly under the headings;

for example,
Code:
Subjects Conditions Fp1_Li..nce Fpz_Li..nce Fp2_Li..nce F7_Lin..nce F3_Lin..nce
S1 MixNeutRem    14.7695    21.5628    22.7087     0.0992     0.3253
S1 MixNeutFor     1.2255     3.5854     5.2456    -1.6241    -1.5311
S1  MixNegRem    -0.5305     2.1425     6.1005     0.8624
S1 MixNegForg     2.6340     4.6610     6.0398     2.3030     2.6258

So, as you can see the raw data itself is not alligned correctly.

Am I right in thinking, this is probably why the script is not working perfectly.

If you know of anyways to correct this I would be very happy!

Thanks

Last edited by Franklin52; 12-03-2011 at 11:38 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-LIST(8)						      System Manager's Manual						      NSDB-LIST(8)

NAME
nsdb-list - list file set name and location entries on an NSDB SYNOPSIS
nsdb-list [-?d] [-e nce] [-l nsdbname] [-r nsdbport] 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-list(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 retrieves the list of file set name and location records stored on an NSDB under one NSDB Container Entry. OPTIONS
-d, --debug Specifies that debugging messages be produced during operation. -?, --help Prints an nsdb-list(8) version and usage message on stderr, then exits. -l, --nsdbname=NSDB-hostname Specifies the hostname of the NSDB to enumerate. If the --nsdbname option is not specified, the value of the FEDFS_NSDB_HOST envi- ronment variable is consulted. If the variable is not set and the --nsdbname option is not specified, the nsdb-list(8) command fails. -r, --nsdbport=NSDB-port Specifies the IP port of the NSDB to enumerate. If the --nsdbport option is not specified, the value of the FEDFS_NSDB_PORT envi- ronment variable is consulted. The default value if the variable is not set is 389. -e, --nce=NSDB-container-entry Limits the query to a particular NSDB Container Entry on the target NSDB. If the --nce option is not specified, the value of the FEDFS_NSDB_NCE environment variable is consulted. If the variable is not set and the --nce option is not specified, or the speci- fied NCE does not exist on the target NSDB, the nsdb-list(8) command fails. EXIT CODES
The NSDB returns a value that reflects the success of the requested operation. FEDFS_OK The LDAP query succeeded. A list of FSN and FSL records are summarized on stdout. FEDFS_ERR_ACCESS The anonymous 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-list(8) command was unable to find a route to the specified NSDB. FEDFS_ERR_NSDB_DOWN The nsdb-list(8) command determined that the specified NSDB was down. FEDFS_ERR_NSDB_CONN The nsdb-list(8) command was unable to establish a connection with the specified NSDB. FEDFS_ERR_NSDB_AUTH The nsdb-list(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-list(8) command and specified NSDB. FEDFS_ERR_NSDB_LDAP_VAL An LDAP error occurred on the connection between the nsdb-list(8) command and specified NSDB. The specific error may be displayed on the command line. FEDFS_ERR_NSDB_NONCE The nsdb-list(8) command was unable to locate the NCE on the specified NSDB. FEDFS_ERR_NSDB_RESPONSE The nsdb-list(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-list(8) command received an LDAP referral that it was unable to follow. FEDFS_ERR_NSDB_LDAP_REFERRAL_VAL The nsdb-list(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-list(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-list(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 want to know if the LDAP server ldap.example.net is an NSDB. Use: $ nsdb-list -l ldap.example.net -e o=fedfs NSDB: ldap.example.net:389 NCE: o=fedfs FSN UUID: c1c21720-1fcd-4ad6-a837-f57af4cf2972 FSL UUID: 4c887035-ad2f-4ba8-ab75-7118df9714cd FSL UUID: 84445758-b5fb-4acc-814b-cc121b3bafe9 There is a single file set name, with two file set location records, registered under "o=fedfs" on this NSDB. To resolve the listed FSN UUID, use the nsdb-resolve-junction(8) command. SECURITY
The NSDB protocol draft standard requires that FedFS FSN and FSL records are readable by everyone. The nsdb-list(8) command uses anonymous binding when performing LDAP queries. 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), nsdb-resolve-junction(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-LIST(8)
All times are GMT -4. The time now is 01:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy