cut and grep command

cut and grep command

Post by Trond Norby » Fri, 19 May 2000 04:00:00



* Joe Au
|
| but i want grep only the first colume and output to a file

cat file | awk ' { print $1 } '

Trond Norbye

 
 
 

cut and grep command

Post by Antti Sinisa » Fri, 19 May 2000 04:00:00




>cat file | awk ' { print $1 } '

Useless use of cat.

awk ' { print $1 } file

will do just fine.

--
Antti Sinisalo
University of Jyvaskyla, Finland

 
 
 

cut and grep command

Post by Joe A » Sat, 20 May 2000 04:00:00


i have a file with the following content:



....

there are few thousand of lines.

but i want grep only the first colume and output to a file

can i use grep and cut command?

Thanks
Joe

 
 
 

cut and grep command

Post by ikeyam » Sat, 20 May 2000 04:00:00


Also
  cut -f 1 -d ' ' file
will work.



> ?cat file | awk ' { print $1 } '

> Useless use of cat.

> awk ' { print $1 } file

 
 
 

1. Help: How to cut last field by CUT command

        Does anyone tell me how to cut only last field in the text line.

For example,

Each line is delimited by `,' and has different number of delimiter;

AAA, BBB, CCC
DDD, EEE
FFF, GGG, HHH, III

I'd liked to get following output

CCC
EEE
III

Thanks in advance
 Haru
--


ZEXEL USA, Inc.   (408) 738-4250 VOICE
265 Santa Ana Ct. (408) 738-4302 FAX  

2. Dial-out problems

3. How to make grep select both lines using only a single 'grep' command

4. Which Net PLIP vs ????

5. Use of grep and awk commands with iostat and mail commands

6. Firewalling: Tools for logging traffic stats needed

7. grep sTerm * | grep -v grep ???

8. Helps on System hanged

9. tail | grep | grep | grep

10. How can grep and cut a chunk of lines of code for a file

11. recurse grep and cut and paste

12. grep and cut for a range of numbers

13. grep/cut