The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
arrange data tools csecnarf Shell Programming and Scripting 1 06-11-2008 04:00 PM
re arrange data kenshinhimura Shell Programming and Scripting 3 04-16-2008 09:06 AM
how to arrange 3 file to one using awk...? penyu Shell Programming and Scripting 9 01-17-2008 05:26 AM
Reverse Arrange File The One UNIX for Dummies Questions & Answers 4 06-13-2007 12:57 PM
re arrange the columns ahmedwaseem2000 Shell Programming and Scripting 0 09-23-2005 03:51 AM

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 03-05-2009
bobo bobo is offline
Registered User
  
 

Join Date: Jan 2006
Posts: 148
Red face Arrange data

I have a following data:

100 200
300 400

I want the data to be arranged:

100 200 300 400

What is the best way to do this?

Thanks!
  #2 (permalink)  
Old 03-05-2009
Neo's Avatar
Neo Neo is offline Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,825
Please search the forums before asking (per the rules, thanks):

Shell script to join a line to the line that follows it

So many examples in the database on this topic.
  #3 (permalink)  
Old 03-05-2009
bobo bobo is offline
Registered User
  
 

Join Date: Jan 2006
Posts: 148
I tried this already and it doen't work. Please reply with solution not a run-around!!!

many thanks!
  #4 (permalink)  
Old 03-05-2009
Neo's Avatar
Neo Neo is offline Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,825
Quote:
Originally Posted by bobo View Post
Please reply with solution not a run-around!!!
You may not realize it, but your reply puts you about 4 mouse click from being banned :-)
  #5 (permalink)  
Old 03-05-2009
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,131
Please do define 'it' and describe the 'not working' part.
What exactly have you tried and what exactly has not worked?

Last edited by vgersh99; 03-06-2009 at 10:54 AM..
  #6 (permalink)  
Old 03-05-2009
quirkasaurus's Avatar
quirkasaurus quirkasaurus is offline
Registered User
  
 

Join Date: Jan 2009
Location: canton, michigan
Posts: 388
probably easier ways but...


Code:
cat << EOF |
100 200
300 400
500 600
700 800
900 1000
EOF

  awk '{
    printf( "%s ", $0 );
    if ( NR % 2 == 0 ){
      printf( "\n" );
      }
    }
    END{
      printf( "\n" );
    }'

output:

Code:
100 200 300 400
500 600 700 800
900 1000

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 10:08 PM.


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