The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to convert columns to rows suresh3566 Shell Programming and Scripting 6 11-04-2008 08:20 AM
merge rows based on a common column smriti_shridhar Shell Programming and Scripting 6 10-17-2008 07:15 AM
awk - reformating rows into columns jmd2004 Shell Programming and Scripting 1 08-14-2008 12:56 AM
Columns to rows mgirinath Shell Programming and Scripting 16 11-29-2007 07:03 PM
Compare two files and merge columns in a third CM64 Shell Programming and Scripting 20 04-04-2007 02:41 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-16-2009
bogu0001 bogu0001 is offline
Banned
  
 

Join Date: Jan 2009
Posts: 32
Question How to merge rows into columns ????

Hi guz I want to merge multiple rows into a multiple columns based on the first column.
The file has symbol //
I want to break the symbool // and I nedd exactlynew column at that point
the output will be like this
please guyz help in this isssue!!!!!



merging rows into columns FIle1

a 1
b 2
c 3
d 4

//

a 9
b 44

//

c 5
d 8
c 4
d 0

Output


a b c d
1 2 3 4
9 44 5 8
4 0
  #2 (permalink)  
Old 01-16-2009
Rhije Rhije is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 103
Add a new column where // is? Your output doesn't show that is what you want.. Could you please give a better example, something that is logical?
  #3 (permalink)  
Old 01-16-2009
bogu0001 bogu0001 is offline
Banned
  
 

Join Date: Jan 2009
Posts: 32
Hi

I have a file with 2 columns. evry set in a column ends with a symbol //.
the first one with something like chr, chr no, chromosome name, cell no. cell no. etc and the second column has values belong to the first columnlike chr Xy, 22, 345,22222 etc. Some clumns have repeated but not duplicate values. with these I want to make file with first cloumn as first row and second olumn as second row and so on...

chr chrXY
chr no 22
chrname FUUR
Cell 224Neuron
Cell no 22222

//

chr chrYY
chr no 23
chrname FUUS
Cell 225Neuron
Cell no 22223

//

chr chrYY
chr no 24
chrname FUUT
Cell 226Neuron
Cell no 22222
Cell 227Neuron
Cell no 222245
Cell 230Neuron
Cell no 22245
//

chr chrYY
chr no 25
chrname RUUS
Cell 225Neuron
Cell no 52223


chr chr no chrname Cell Cell no
chrXY 22 FUUR 224Neuron 22222
chrYY 23 FUUS 225Neuron 22223
chrYY 24 FUUT 226Neuron 222222
227Neuron 222245
230Neuron 22245
chrYY 25 RUUS 225Neuron 52223
  #4 (permalink)  
Old 01-16-2009
bogu0001 bogu0001 is offline
Banned
  
 

Join Date: Jan 2009
Posts: 32
227Neuron 222245
230Neuron 22245 will be in their successive related column.
some font error is preveting the alignment
  #5 (permalink)  
Old 01-16-2009
bogu0001 bogu0001 is offline
Banned
  
 

Join Date: Jan 2009
Posts: 32

Output



chr .........chr no....... chrname ......Cell............. Cell no

chrXY....... 22 ............FUUR .........224Neuron..... 22222
chrYY .......23 .............FUUS .........225Neuron .....22223
chrYY....... 24 .............FUUT.......... 226Neuron.... 222222
...................................................227Neuron.... 222245
..................................................230Neuron ......22245
chrYY .......25............. RUUS ..........225Neuron ......52223
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:02 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0