The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 a single column into several rows and columns? ashton_smith UNIX for Dummies Questions & Answers 5 05-24-2008 04:44 PM
sed or awk to convert text files with recurring headings to rows and colum Bjoeboo Shell Programming and Scripting 5 05-07-2008 10:47 AM
shell script required to convert rows to columns suresh3566 Shell Programming and Scripting 2 05-07-2008 05:25 AM
splitting a column into rows spindoctor UNIX for Dummies Questions & Answers 3 07-24-2007 03:25 PM
Factorize some rows in a column frebo UNIX for Dummies Questions & Answers 5 03-21-2006 06:41 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-11-2008
cdfd123 cdfd123 is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 112
convert rows into column

if u have a data

2 4 6 8 5 4 4 5 6

then result shud be like
2
4
6
7
5
4
4
5
6
  #2 (permalink)  
Old 01-11-2008
Klashxx's Avatar
Klashxx Klashxx is offline Forum Advisor  
HP-UX/Linux/Oracle
  
 

Join Date: Feb 2006
Location: Almería, Spain
Posts: 393
Code:
echo "2 4 6 8 5 4 4 5 6\c"|awk '1' RS=" "
  #3 (permalink)  
Old 01-11-2008
shamrock shamrock is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2007
Location: USA
Posts: 741
Quote:
Originally Posted by cdfd123 View Post
if u have a data

2 4 6 8 5 4 4 5 6

then result shud be like
2
4
6
7
5
4
4
5
6
Code:
echo 2 4 6 8 5 4 4 5 6 | tr ' ' '\n'
  #4 (permalink)  
Old 01-11-2008
ghostdog74 ghostdog74 is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2006
Posts: 2,422
Code:
# s="2 4 6 8 5 4 4 5 6"
# for items in $s; do echo $items; done
2
4
6
8
5
4
4
5
6
Sponsored Links
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:47 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
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