Unix/Linux Go Back    


Shell Programming and Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and shell scripts and shell scripting languages here.

Want to format column of a text file

Shell Programming and Scripting


Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 12-11-2012
atul9806 atul9806 is offline
Registered User
 
Join Date: Jan 2011
Last Activity: 6 May 2013, 1:01 AM EDT
Posts: 86
Thanks: 5
Thanked 7 Times in 6 Posts
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.


Code:
CCMS_BAU_from_CACHE      RUN
ETL_SUBSITE_TO_SITE_BAU  RUN
GetClient_Prep_Main      RUN
MDM_Client_BAU   RUN
Sweeper  RUN
Staging_To_Reporting     RUNNING
Bridge_BAU       RUN
CMT_CUSTOMER_BAU RUN
CMT_CLIENT_HIERARCHY_BAU RUN
SAP_CUST_NI_CCMS RUN
CLIENT_DUNS_CUST_NI_CCMS RUN

as you can see Job status is not in a Column, I need them in a column
Please help


Thanks
Atul Singh

Last edited by Scrutinizer; 12-11-2012 at 02:55 AM.. Reason: Removed link
Sponsored Links
    #2  
Old Unix and Linux 12-11-2012
Joseph_TKLee Joseph_TKLee is offline
Registered User
 
Join Date: Nov 2012
Last Activity: 24 September 2013, 6:55 AM EDT
Location: Brisbane, Australia
Posts: 40
Thanks: 3
Thanked 10 Times in 10 Posts
Can you please show me what output looks like?
don't understand your question.

Cheers,
Sponsored Links
    #3  
Old Unix and Linux 12-11-2012
rdcwayx rdcwayx is offline Forum Advisor  
Use nawk in Solaris
 
Join Date: Jun 2006
Last Activity: 22 March 2014, 12:27 PM EDT
Posts: 2,759
Thanks: 44
Thanked 419 Times in 407 Posts
show us the sample log content.
    #4  
Old Unix and Linux 12-11-2012
atul9806 atul9806 is offline
Registered User
 
Join Date: Jan 2011
Last Activity: 6 May 2013, 1:01 AM EDT
Posts: 86
Thanks: 5
Thanked 7 Times in 6 Posts
Input

Linux

I need the o/p like this

Linux

please help

thanks
Atul Singh

Last edited by Scrutinizer; 12-11-2012 at 02:56 AM.. Reason: Removed links and extra images
Sponsored Links
    #5  
Old Unix and Linux 12-11-2012
ripat ripat is offline Forum Advisor  
Registered User
 
Join Date: Oct 2006
Last Activity: 17 February 2014, 7:51 AM EST
Location: Belgium
Posts: 537
Thanks: 4
Thanked 39 Times in 28 Posts
If your distro *NIX version has that utility:


Code:
column -t file

Sponsored Links
    #6  
Old Unix and Linux 12-11-2012
atul9806 atul9806 is offline
Registered User
 
Join Date: Jan 2011
Last Activity: 6 May 2013, 1:01 AM EDT
Posts: 86
Thanks: 5
Thanked 7 Times in 6 Posts
Sorry, I am using AIX and in that column command is not installed
Please suggest another solution

thx
Atul Singh
Sponsored Links
    #7  
Old Unix and Linux 12-11-2012
PikK45 PikK45 is offline
Registered User
 
Join Date: Jul 2012
Last Activity: 27 July 2015, 2:10 AM EDT
Location: Chennai
Posts: 573
Thanks: 50
Thanked 75 Times in 73 Posts
Do you know the max_length of the first column?
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Replacing a specific column of a text file with another column evelibertine UNIX for Dummies Questions & Answers 3 06-28-2011 04:38 PM
Assigning a specific format to a specific column in a text file using awk and printf goodbenito Shell Programming and Scripting 2 04-30-2010 09:25 AM
Convert comma text file to Column in html format sriram003 Shell Programming and Scripting 9 03-31-2009 08:16 AM
AWK CSV to TXT format, TXT file not in a correct column format mdap Shell Programming and Scripting 1 08-14-2008 11:03 AM
Format a column of text mlucas UNIX for Dummies Questions & Answers 2 08-16-2006 03:52 PM



All times are GMT -4. The time now is 09:51 AM.