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
column 1 line transitions part two! ajp7701 Shell Programming and Scripting 7 04-18-2008 06:16 PM
different line and column ? tahsinaltay Shell Programming and Scripting 5 02-06-2008 09:06 AM
awk to select a column from particular line number mab_arif16 Shell Programming and Scripting 4 05-08-2006 06:26 AM
Print the line containing the maximum value in a column kingkong UNIX for Advanced & Expert Users 22 02-03-2006 10:38 AM
Search for by column and delete line thudak Shell Programming and Scripting 4 04-24-2002 10:13 AM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 01-16-2008
genix2008 genix2008 is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 5
Question line to column using awk

hi,

i'm a newbie and this is my first post here. 'hope all of you fellow members are doing fine. so here is my first thread to ask for help on how to use awk language to do this task.

i have a file to process and after a series of other awk commands and shell scripts i managed to convert the output into something like this...

string1
string2
string3
string4
string5
string(n)

and by the awk command...

awk 'BEGIN {FS="\n";RS="";ORS=""} { x=1; while (x<NF) {print $x"\t"; x++} print $NF "\n"}'

i get the output...

string1 string2 string3 string4 string5 string6 string7 ....... string(n) - all in one line separated by tab

now, my last task is to separate this line into 3 column each line like...

string1 string2 string3
string4 string5 string6
string7 string8 string(n)

my guess is that i can pipe another awk command to my last awk above or i can just disregard that awk command that converts all string in one line and go directly to the 3 column format but i haven't got any clue on how to do as well. can anyone help me code this in awk?

thanks in advance!

Last edited by genix2008; 01-16-2008 at 11:39 PM..
 

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 08:23 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