Sponsored Content
Top Forums Shell Programming and Scripting Help with column specification Post 302662241 by Jazmania on Tuesday 26th of June 2012 11:01:48 AM
Old 06-26-2012
Hi,
Guessing you'd need something like this...

Code:
  COLUMN_NO=$1
  
  case  $COLUMN_NO in
  column_1 )
      awk -F [ ' '] ' { print $1, $2, $3, $4, $5, $6' } < yourfilename
       ;;
  column_2 )
      awk -F [ ' '] ' { print $2, $3, $4, $5, $6' } < yourfilename
       ;;
  column_3 )
      awk -F [ ' '] ' { print $3, $4, $5, $6' } < yourfilename
       ;;
   column_4 )
      awk -F [ ' '] ' { print $4, $5, $6' } < yourfilename
       ;;
  column_5 )
      awk -F [ ' '] ' { print $5, $6' } < yourfilename
       ;;
  column_6 )
      awk -F [ ' '] ' { print $6' } < yourfilename
             ;;      
    esac
fi

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

HD specification

What command do I use to determine how many/what kind/how big the hard drives on a box are? (2 Replies)
Discussion started by: abolshoun
2 Replies

2. What is on Your Mind?

Internation Standards Networking Specification

I seem to get lost when it comes in terms of Networking types and its specifications by different International bodies. I am not able to understand things like - "synchronous operation on public data networks networking protocol" "packet mode connected to public data networks by dedicated... (1 Reply)
Discussion started by: S.P.Prasad
1 Replies

3. UNIX for Dummies Questions & Answers

Sed character number specification

I have the following sed command: sed '/7361105/s/^\(..............................................................................................................................................................................\)....\(.*\)/\16776\2/' arch.txt > arch.tmp && mv arch.tmp arch.txt ... (4 Replies)
Discussion started by: mvalonso
4 Replies

4. Solaris

hardware specification ( very Urgent please )

I wana know my box hardware specification ( Like RAM , processor speed .... Etc ) and used version of Solaris i mean (SPARC, 32-bit) or (x86, 32-bit) or(SPARC, 64-bit) or what ?? very Urgent please (5 Replies)
Discussion started by: KSA
5 Replies

5. Solaris

System specification checking

Hi, anybody know how to check the system specification for the unix by using the command like the memory size, cpu's speed and etc. Thanks. (3 Replies)
Discussion started by: efang
3 Replies

6. Shell Programming and Scripting

Range specification in for loop

Hello Friends, I want to use range in for loop. For that i used (..) operator but it is not working. Ex: for i in 1..24 do echo $i done Instead of printing 1 to 24 nos, it gives o/p as: 1..24 Please help me Thanks in advance. (2 Replies)
Discussion started by: Niyati
2 Replies

7. UNIX for Dummies Questions & Answers

RSC card specification

Hi I have a SUN box that i am supporting Model 480r . The RS card that is attached to it is giving some problems . It is pinging but i am unable to telnet into it therefore having no remote TC console access ( the system is currently up ) Is there a way by which i can remotely check the... (1 Reply)
Discussion started by: Sam4u
1 Replies

8. Solaris

Getting server specification

Hi all, Can anyone help me to get the server specifications like the following? eg. SUN Fire XXX X UltraSPARC X MHZ X MB Memory X GB od hard disk X On board PCI IO card X PCI HNI card Thanks. (4 Replies)
Discussion started by: beginningDBA
4 Replies

9. AIX

sudo - User privilege specification

I am planning to implement sudo for users. Under , it looks I have to put the users who need to have sudo access: What are the recommended for users? I don't think I need to give the ALL privilege (i.e ) to AIX users. I'd like to know the commonly used privilege specification for sudo... (9 Replies)
Discussion started by: Daniel Gate
9 Replies

10. UNIX for Advanced & Expert Users

Help with touch: bad time specification

Here is the part of the script: I have modified the file name.:) SSFILE=${My_HOME_DIR}/log/my_file_ss.log export MM=`date '+%m'` export DD=`date '+%d'` export HH=`date '+%H'` export MIN=`date '+%M'` export HOURAGO=`echo ${HH} -1 |bc ` echo $HOURAGO export TTIME=${MM}${DD}${HOURAGO}00... (5 Replies)
Discussion started by: N1a_Raider
5 Replies
COLUMN(1)						    BSD General Commands Manual 						 COLUMN(1)

NAME
column -- columnate lists SYNOPSIS
column [-tx] [-c columns] [-s sep] [file ...] DESCRIPTION
The column utility formats its input into multiple columns. Rows are filled before columns. Input is taken from file operands, or, by default, from the standard input. Empty lines are ignored. The options are as follows: -c Output is formatted for a display columns wide. -s Specify a set of characters to be used to delimit columns for the -t option. -t Determine the number of columns the input contains and create a table. Columns are delimited with whitespace, by default, or with the characters supplied using the -s option. Useful for pretty-printing displays. -x Fill columns before filling rows. Column exits 0 on success, >0 if an error occurred. ENVIRONMENT
COLUMNS The environment variable COLUMNS is used to determine the size of the screen if no other information is available. EXAMPLES
(printf "PERM LINKS OWNER GROUP SIZE MONTH DAY HH:MM/YEAR NAME " ; ls -l | sed 1d) | column -t SEE ALSO
colrm(1), ls(1), paste(1), sort(1) HISTORY
The column command appeared in 4.3BSD-Reno. AVAILABILITY
The column command is part of the util-linux-ng package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/. BSD
June 6, 1993 BSD
All times are GMT -4. The time now is 10:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy