Home » Infrastructure » Unix » Allign output
Allign output [message #378934] Fri, 02 January 2009 14:36 Go to next message
shoaib123
Messages: 118
Registered: December 2007
Location: Chicago
Senior Member
HI ..

I have file containing data something like this... tab seprated


TABLE NAME	LOADED RECORDS	ACTUAL RECORDS
HIST	57164136	57164136
LOAN_A	48025468	48025468
LOAN	28867178	28867178
BANKRUPTCY_TAB	280695	280695


The data is not alligh and not completey freindly viewable. I am expecting the output something like this..

TABLE NAME	LOADED RECORDS	ACTUAL RECORDS
HIST		57164136	57164136
LOAN_A		48025468	48025468
LOAN		28867178	28867178
BANKRUPTCY_TAB	280695		280695


Any help would be appreciated..
Re: Allign output [message #378936 is a reply to message #378934] Fri, 02 January 2009 14:53 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
How is this related to Oracle?

Regards
Michel
Re: Allign output [message #378939 is a reply to message #378934] Fri, 02 January 2009 16:19 Go to previous messageGo to next message
Barbara Boehmer
Messages: 9077
Registered: November 2002
Location: California, USA
Senior Member
If, for example, you do a select from an Oracle table using SQL*Plus, and spool the output to some text file, then the columns should be aligned. However, if you open this file using some tool that uses a proportional font, then it can destroy the alignment of the columns. Try making sure that you are using a non-proportional font when viewing. If this doesn't help, then please be more specific as to what you are doing and how using what, especially how it relates to Oracle.
Re: Allign output [message #378943 is a reply to message #378936] Fri, 02 January 2009 18:53 Go to previous message
shoaib123
Messages: 118
Registered: December 2007
Location: Chicago
Senior Member
Sorry not mentioned earlier.. this is unix related question..

something like this will work to allign the output..

nawk '{printf "%15s %15s %15s\n", $1,$2, $3}' file_name

[Updated on: Sat, 03 January 2009 07:13]

Report message to a moderator

Previous Topic: how to delete lines through shell command
Next Topic: unable to run rman
Goto Forum:
  


Current Time: Thu Mar 28 06:32:24 CDT 2024