[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: reading the first colums of text file
From: |
Bob Proulx |
Subject: |
Re: reading the first colums of text file |
Date: |
Sat, 3 Feb 2007 10:59:14 -0700 |
User-agent: |
Mutt/1.5.9i |
flowdimow wrote:
> I have a text file (a table) and I want to read it and output only a
> defined number of colums. Does anybody know how to do this?
Depending on if the data is by character column or by whitespace
separated field I would use either cut or awk.
echo abcdefghijklmnopqrstuvwxyz | cut -c3-4,14-23
cdnopqrstuvw
echo one two three four five six seven | awk '{print$2,$NF}'
two seven
Bob