|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need a different command to display text files
hi,
i need a command to display text files. How can i list the lines between 5 and 8? $ XXXXXXXXXX what to write thanks to jim macnamara |
|
#2
|
|||
|
|||
|
If you want the lines that occur physically in the file on lines 5,6,7,8
Code:
awk ' { if (NR>4 && NR < 9) print $0} ' filename
If the data has literally got the number 5 or 6 etc. in the second column Code:
awk ' { if ($2>4 && $2 < 9) print $0} ' filename
|
|
#3
|
|||
|
|||
|
Quote:
also can use Code:
head -8 <filename> | tail -4 efficient only for small file |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Need a different command to display text files |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|