Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

column(1) [linux man page]

COLUMN(1)						    BSD General Commands Manual 						 COLUMN(1)

NAME
column -- columnate lists SYNOPSIS
column [-ntx] [-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. -n By default, the column command will merge multiple adjacent delimiters into a single delimiter when using the -t option; this option disables that behavior. This option is a Debian GNU/Linux extension. ENVIRONMENT
The COLUMNS, LANG, LC_ALL and LC_CTYPE environment variables affect the execution of column as described in environ(7). EXIT STATUS
The column utility exits 0 on success, and >0 if an error occurs. EXAMPLES
(printf "PERM LINKS OWNER GROUP SIZE MONTH DAY " ; printf "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. BUGS
Input lines are limited to LINE_MAX (2048) bytes in length. BSD
July 29, 2004 BSD

Check Out this Related Man Page

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. DIAGNOSTICS
The column utility exits 0 on success, and >0 if an error occurs. 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 " ; printf "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. BSD
June 6, 1993 BSD
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

field substitution w/awk

I want to replace columns 15 thru 22 with a date in this format mmddyyyy in a file that has fixed record length of 110 columns. Only lines with column 1 = "T" will be changed but I can't seem to get it to work. I saw several postings and tried to work with them but they don't work for me... ... (12 Replies)
Discussion started by: giannicello
12 Replies

2. Shell Programming and Scripting

Help removing lines with duplicated columns

Hi Guys... Please Could you help me with the following ? aaaa bbbb cccc sdsd aaaa bbbb cccc qwer as you can see, the 2 lines are matched in three fields... how can I delete this pupicate ? I mean to delete the second one if 3 fields were duplicated ? Thanks (14 Replies)
Discussion started by: yahyaaa
14 Replies

3. Shell Programming and Scripting

Reg : add column

Hi unixpals, I need an shell script to append one related to the below csv file: my data is looks like : 3444 546666 RANDON 61762 AAAA VVVV bbbb vvvv I need to append one column in first for each and every ro for the entire csv file.For ex: 10Jun2006 3444 546666 RANDON 61762 AAAA VVVV... (14 Replies)
Discussion started by: 4urevers
14 Replies

4. Shell Programming and Scripting

AWK program

Hi all, I have the following problem and hope someone could help me. I have 184 files, each with 5 columns (c1, c2, c3, c4, c5). I am only interrested in column 5, and would like to paste column 5 from all the 184 files into one file. I have tried the following with two files awk... (20 Replies)
Discussion started by: awkliker
20 Replies

5. Shell Programming and Scripting

Sorting based on Multiple columns

Hi, I have a requirement whereby I have to sort a flat file based on Multiple Columns (similar to ORDER BY Clause of Oracle). I am getting 10 columns in the flat file and I want the file to be sorted on 1st, 3rd, 4th, 7th and 9th columns in ascending order. The flat file is pipe seperated. Any... (15 Replies)
Discussion started by: dharmesht
15 Replies

6. Shell Programming and Scripting

Paste value at specific column using sed

Hi I want to paste some value at specific column in a file using sed. say I want to add "Welcome to UNIX" from column 300 onwards in a file using sed. How to do it . ---------- Post updated at 11:18 AM ---------- Previous update was at 11:09 AM ---------- Adding more information : I... (14 Replies)
Discussion started by: dashing201
14 Replies

7. Shell Programming and Scripting

have to retrieve the distinct values (not duplicate) from 2nd column and display

I have a text file names test2 with 3 columns as below . We have to retrieve the distinct values (not duplicate) from 2nd column and display. I have used the below command but giving some error. NS3303 NS CRAFT LTD NS3303 NS CHIRON VACCINES LTD NS3303 NS ALLIED MEDICARE LTD NS3303 NS... (16 Replies)
Discussion started by: shirdi
16 Replies

8. UNIX for Dummies Questions & Answers

The meaning of %s in printf

I have this command like that has %s in it, I know %s calls a column, but I am not sure I understand which column (I mean for my case I can check the input file, but I want to know how is this %s used, how comes tha same symbo; gives different columns in one command line: {printf "grep %s... (22 Replies)
Discussion started by: cosmologist
22 Replies

9. Shell Programming and Scripting

Split into columns based on the parameter and use & as delimiter

Here is my source, i have million lines like this on a file. disp0201.php?poc=4060&roc=1&ps=R&ooc=13&mjv=6&mov=5&rel=5&bod=155&oxi=2&omj=5&ozn=1&dav=20&cd=&daz=& drc=&mo=&sid=&lang=EN&loc=JPN I want to split this into columns in order to load in database, anything starts with"&mjv=6" as first... (13 Replies)
Discussion started by: elamurugu
13 Replies

10. Shell Programming and Scripting

Copying of multiple columns of one table to another by mapping with particular strings.

Hi, I would like to copy some columns from a particular file by mapping with the string names. i am using the .csv file format. my one file consist of 100 of columns but i want only particular 4 columns such as ( First_name, Middle_name,Last_name & Stlc). but they are listed in many files... (15 Replies)
Discussion started by: dsh007
15 Replies

11. UNIX for Dummies Questions & Answers

Copy column to another column in unix

Dear Gurus, I have a unix file 2 columns (# delimited) with the following data: ZTXX_CTBR1-ZBRAN1#ZTXX_CTBR1-ZBRAN_DESC# 01#CASH & CARRY# 02#DRUGSTORE - RX# 04#SUPERMARKET# 05#HYPERMARKET# 17#DRUGSTORE - NO RX# I would like to have a code that will do 2 things: 1. Delete the header... (16 Replies)
Discussion started by: chumsky
16 Replies

12. Shell Programming and Scripting

Triming spaces few columns

File contains 10 columns,i want trim the 2,4,10 columns using single unix command. Please suggest me how to do? Thanks (21 Replies)
Discussion started by: bmk
21 Replies

13. UNIX for Dummies Questions & Answers

Awk, ouptut columns in a file by column name

Hi, i am posting this after not finding proper solution in any other discussion threads I have a text data file with the first row as the column header names. The file can be comma, tab, space, pipeline, .... delimited Example of a pipeline delimited: file1.txt... (14 Replies)
Discussion started by: ysrini
14 Replies

14. Shell Programming and Scripting

Help with merge data with a reference sequence

I have two input file.: File 1 is a large reference sequence (A large Fasta sequence); File 1 (is a file which first line is the header description and line other ">" is its corresponding word and counting from 1 till end of file); >Data_1 ASWDADAQTWQQGSAAAAASDAFAFA . . File 2 is... (31 Replies)
Discussion started by: cpp_beginner
31 Replies

15. Shell Programming and Scripting

sed command to replace multiple column in one go

Hi, I want to replace the value in more than one column. For one column ,following command is working - sed 's/./$value_to_replace/$column number' file_name e.g. suppose this is input 1111000000 command - sed 's/./M/5' output= 1111M000000 For two column also command is like - cat... (22 Replies)
Discussion started by: Preeti Chandra
22 Replies