Format a column of text


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Format a column of text
# 1  
Old 08-16-2006
Question Format a column of text

Hi

I have a LONG ! column of text and I would like to format this into several columns.

so from this

abcd
efgh
ijkl
mnop
qrst
uvwx
yz12

to this

abcd efgh ijkl
mnop qrstu vwx
yz12

Smilie any help would be great
THANKS !
# 2  
Old 08-16-2006
Code:
nawk 'ORS=NR%3?OFS:RS' myFile
pr -a -3 -t -s' ' myFile

# 3  
Old 08-16-2006
Also

Code:
paste -d ' ' - - - < infile

Cheers
ZB
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Format column datas

I have some data like this: 4258092 TRXCODE a 19 CARDNBR a 10 PINFLAG a 6 FUISSUER a 12 PRODUCT a 24 STATE n 1 I want out put this format: <?xml version="1.0" encoding="GB2312"?> <convGrp> <grpid>4258092</grpid> <script> <!]> ... (4 Replies)
Discussion started by: hhdzhu
4 Replies

2. Shell Programming and Scripting

Need script for transferring bulk files from one format to text format

"Help Me" Need script for transferring bulk files from one format to text format in a unix server. Please suggest (2 Replies)
Discussion started by: Kranthi Kumar
2 Replies

3. Shell Programming and Scripting

Want to format column of a text file

Hi Techies I have written a script which is collecting the logs of job running on server and let mail me the output. I want to format column of output, please help. CCMS_BAU_from_CACHE RUN ETL_SUBSITE_TO_SITE_BAU RUN GetClient_Prep_Main RUN MDM_Client_BAU RUN Sweeper RUN... (11 Replies)
Discussion started by: atul9806
11 Replies

4. UNIX for Dummies Questions & Answers

Replacing a specific column of a text file with another column

Hi, I have a text file in the following format: Code: 13412 NA06985 0 0 2 46.6432798439 4 4 4 4 13412 NA06991 NA06993 NA06985 2 48.8478948517 4 4 2 4 13412 NA06993 0 0 1 45.8022601455 4 4 2 4 13401 NA06994 0 0 1 48.780669145 4 4 4 4 13401 NA07000 0 0 2 47.7312017846 2 4 4 4 ... (2 Replies)
Discussion started by: evelibertine
2 Replies

5. UNIX for Dummies Questions & Answers

Replacing a specific column of a text file with another column

I have a text file in the following format: 13412 NA06985 0 0 2 46.6432798439 4 4 4 4 13412 NA06991 NA06993 NA06985 2 48.8478948517 4 4 2 4 13412 NA06993 0 0 1 45.8022601455 4 4 2 4 13401 NA06994 0 0 1 48.780669145 4 4 4 4 13401 NA07000 0 0 2 47.7312017846 2 4 4 4 13402 NA07019... (3 Replies)
Discussion started by: evelibertine
3 Replies

6. Shell Programming and Scripting

Format Column

I need a script that takes it input wither it be from a file or inputed as variables and sort that into three columns. Thanks (3 Replies)
Discussion started by: prottheman
3 Replies

7. Shell Programming and Scripting

Assigning a specific format to a specific column in a text file using awk and printf

Hi, I have the following text file: 8 T1mapping_flip02 ok 128 108 30 1 665000-000008-000001.dcm 9 T1mapping_flip05 ok 128 108 30 1 665000-000009-000001.dcm 10 T1mapping_flip10 ok 128 108 30 1 665000-000010-000001.dcm 11 T1mapping_flip15 ok 128 108 30... (2 Replies)
Discussion started by: goodbenito
2 Replies

8. Shell Programming and Scripting

How to format a column

Hi everybody I want to manipulate the output of this command: df -h to something like this: df -h | awk '{print"\t\t "$1"\t\t"$6"\t\t"$2"\t\t" $4}' | sed 's/Mounted/Mount Point/g' | sed 's/Avail/Free Space/g'but my problem is: if for example the mounting point is a long name everything beside... (3 Replies)
Discussion started by: ialbert
3 Replies

9. Shell Programming and Scripting

Convert comma text file to Column in html format

I am trying to generate a report with below file : File1 : EQADM,edrtere9-phys,8122caef0,gpatmon,/bin/ksh,nuten Erick EQADM,edrtere11-phys,8227caef0,gpatmon,/bin/ksh,nuten Erick EQADM,edrtere3-phys,822caef0,gpatmon,/bin/ksh,nuten Erick can you help me convert it to html and add... (9 Replies)
Discussion started by: sriram003
9 Replies

10. Shell Programming and Scripting

AWK CSV to TXT format, TXT file not in a correct column format

HI guys, I have created a script to read 1 column in a csv file and then place it in text file. However, when i checked out the text file, it is not in a column format... Example: CSV file contains name,age aa,11 bb,22 cc,33 After using awk to get first column TXT file... (1 Reply)
Discussion started by: mdap
1 Replies
Login or Register to Ask a Question