It is currently Mon, 27 Jun 2022 12:52:26 GMT



 
Author Message
 How to extract columns from a text file?
Is there a unix command to extract only certain columns of data from a
large text file, assuming everything is organized into columns? Or can vi
do this?

Thanks in advance,

Faraz.



 Sat, 12 Jan 2002 03:00:00 GMT   
 How to extract columns from a text file?
In article <7nl0ga$sf...@vixen.cso.uiuc.edu>,
faraz hussain  <fhuss...@ux9.cso.uiuc.edu> wrote:

cut or awk can do this.  Read their man pages.

man cut
man awk
man gawk

Chuck Demas
Needham, Mass.

--
  Eat Healthy    |   _ _   | Nothing would be done at all,
  Stay Fit       |   @ @   | If a man waited to do it so well,
  Die Anyway     |    v    | That no one could find fault with it.
  de...@tiac.net |  \___/  | http://www.tiac.net/users/demas



 Sat, 12 Jan 2002 03:00:00 GMT   
 How to extract columns from a text file?
man cut

e.g.  if file.name contains

a b c
d e f
i j k

cut -f1 -d" " file.name gives

a
d
i



 Sat, 12 Jan 2002 03:00:00 GMT   
 How to extract columns from a text file?
cut
awk
sed
perl

to join seders (sed mailing list)
email
af...@torfree.net

: Is there a unix command to extract only certain columns of data from a
: large text file, assuming everything is organized into columns? Or can vi
: do this?

: Thanks in advance,

: Faraz.
--
=-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
al aab, seders moderator                                      sed u soon
               it is not zat we do not see the  s o l u t i o n          
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+



 Sun, 13 Jan 2002 03:00:00 GMT   
 
   [ 4 post ] 

Similar Threads

1. Sorting a 2 column text file

2. Searching for text in a column in a file

3. How to print columns of text-file?

4. Add a column of text in a text document

5. Extracting text from a file

6. Postscript file corrupted - extracting text/patching


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software