2012-12-27 8 views

risposta

15

Molti modi:

cut -d' ' -f1 <filename # If field separator is space 
cut -f1 <filename # If field separator is tab 
cut -d' ' -f1 <filename | cut -f1 # If field separator is space OR tab 
awk '{print $1}' filename 
while read x _ ; do echo $x ; done < filename 
1
cut -d " " -f1 test.txt 

dove test.txt contiene la linea di ingresso

Problemi correlati