2012-12-27 12 views

Odpowiedz

15

wiele sposobów:

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 

gdzie test.txt zawiera linię wejściową

Powiązane problemy