Sponsored Content
Full Discussion: Lines to Column conversion
Top Forums Shell Programming and Scripting Lines to Column conversion Post 302698517 by raj_saini20 on Monday 10th of September 2012 07:45:37 AM
Old 09-10-2012
Code:
awk '{a[NR]=$0;if(length>max) max=length}END{for(j=1;j<=max;j++){for(i=1;i<=NR;i++){printf "%s ",substr(a[i],j,1)};printf "\n"}}' filename

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

column to row conversion with additional pattern

Hi there, I've an input file1 as follows: 1001 1002 1003 1004 1005 I would like to have an output file2 as follows: Numbers are 1001/ 1002/ 1003/ 1004/ 1005/ Any help is appreciated. (2 Replies)
Discussion started by: kbirde
2 Replies

2. UNIX for Dummies Questions & Answers

converting unique identifiers in a column using conversion file

Hello, I often have this problem: I have a file with a column of unique identifiers e.g. file1 below has an id column and data column/columns with p rows: cat data1 dog data2 cow data3 . . . elephant datap-1 horse datap and I have a conversion file,file2, with n<p rows... (4 Replies)
Discussion started by: peanuts48
4 Replies

3. Shell Programming and Scripting

Filtering lines for column elements based on corresponding counts in another column

Hi, I have a file like this ACC 2 2 21 aaa AC 443 3 22 aaa GCT 76 1 33 xxx TCG 34 2 33 aaa ACGT 33 1 22 ggg TTC 99 3 44 wee CCA 33 2 33 ggg AAC 1 3 55 ddd TTG 10 1 22 ddd TTGC 98 3 22 ddd GCT 23 1 21 sds GTC 23 4 32 sds ACGT 32 2 33 vvv CGT 11 2 33 eee CCC 87 2 44... (1 Reply)
Discussion started by: polsum
1 Replies

4. Shell Programming and Scripting

Row to Column conversion?

I have a text file with the geneIds separated by space in each line. The number Ids in lines are different. The file is like: abc qwe tyu ghj jkl dfg sdf cvb sdk fgh tyu uio iop tyu rty eru wer rty iop asd sdf dfg fgh zxc I want to format the file like: abc qwe tyu ghj jkl ... (7 Replies)
Discussion started by: sammy777
7 Replies

5. Solaris

Rows to column conversion in Solaris

i am using the command pkginfo -l | /usr/xpg4/bin/grep -e 'VENDOR' -e 'NAME' -e 'VERSION' >> /tmp/test1.txt in order to get name,vendor and version of the applications installed on Solaris machine.The output stored in test1.txt in as shown below: NAME: Solaris Zones (Usr) VERSION: ... (4 Replies)
Discussion started by: omkar.jadhav
4 Replies

6. Shell Programming and Scripting

awk Print New Column For Every Two Lines and Match On Multiple Column Values to print another column

Hi, My input files is like this axis1 0 1 10 axis2 0 1 5 axis1 1 2 -4 axis2 2 3 -3 axis1 3 4 5 axis2 3 4 -1 axis1 4 5 -6 axis2 4 5 1 Now, these are my following tasks 1. Print a first column for every two rows that has the same value followed by a string. 2. Match on the... (3 Replies)
Discussion started by: jacobs.smith
3 Replies

7. UNIX for Dummies Questions & Answers

[Solved] Uneven column to row conversion

Hi Unix Forum, I have a relatively easy question i suppose for which, however, until now i could not find a solution. I am working with a program that will give me an output file similar to the following: A 1 2 3 4 B 1 2 3 4 C 1 (9 Replies)
Discussion started by: Leander
9 Replies

8. Shell Programming and Scripting

Conversion if 1st column is match (awk '{s+=$1} END

Hi im trying to add numbers, got no problem with it im using awk '{s+=$1} END {print s, "MB"}', but what if the numbers are like mention below. who will i add them 2000 KB 1 MB Answer: 2001 Desired: 2000 KB 1 MB Answer: 3000 (4 Replies)
Discussion started by: invinzin21
4 Replies

9. Shell Programming and Scripting

Text Conversion in Column

Hi all; We have a table: COL1 COL2 COL3 COL4 COL5 COL6 COL7 val1 val2 val3 val4 val5 1 val7 val1 val2 val3 val4 val5 3 val7 val1 val2 val3 val4 val5 5 val7 val1 val2 val3 val4 val5 2 val7 ... As you see, 6th columns are filled with numbers as, 1, 2, 3, 4, etc... and I want to make a... (10 Replies)
Discussion started by: gc_sw
10 Replies

10. UNIX for Advanced & Expert Users

Conversion of rows to columns using awk based om column value

HI, My Input file data is dn:adcfgeneral id:13343 Name:xxxxxx Password:iutyerwuitywue wpuwt tuiytruityrutyrwtyrwp dn:cdferwjyyyy id:3875 Name:yyyy Password :hgfdsjkfhdsfkdlshf dshfkldshfdklsfh interset:uiuiufj My output should be ... (6 Replies)
Discussion started by: dineshaila
6 Replies
Text::Password::Pronounceable(3pm)			User Contributed Perl Documentation			Text::Password::Pronounceable(3pm)

NAME
Text::Password::Pronounceable - Generate pronounceable passwords SYNOPSIS
# Generate a pronounceable password that is between 6 and 10 characters. Text::Password::Pronounceable->generate(6, 10); # Ditto my $pp = Text::Password::Pronounceable->new(6, 10); $pp->generate; DESCRIPTION
This module generates pronuceable passwords, based the the English digraphs by D Edwards. METHODS new $pp = Text::Password::Pronounceable->new($min, $max); $pp = Text::Password::Pronounceable->new($len); Construct a password factory with length limits of $min and $max. Or create a password factory with fixed length if only one argument is provided. generate $pp->generate; $pp->generate($len); $pp->generate($min, $max); Text::Password::Pronounceable->generate($len); Text::Password::Pronounceable->generate($min, $max); Generate password. If used as an instance method, arguments override the factory settings. HISTORY
This code derived from mpw.pl, a bit of code with a sordid history. o CPAN module by Chia-liang Kao 9/11/2006. o Perl cleaned up a bit by Jesse Vincent 1/14/2001. o Converted to perl from C by Marc Horowitz, 1/20/2000. o Converted to C from Multics PL/I by Bill Sommerfeld, 4/21/86. o Original PL/I version provided by Jerry Saltzer. LICENSE
Copyright 2006 by Best Practical Solutions, LLC. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See <http://www.perl.com/perl/misc/Artistic.html> perl v5.10.1 2010-08-16 Text::Password::Pronounceable(3pm)
All times are GMT -4. The time now is 05:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy