|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
How to search particluar line in file ? My file have 2,600,000 line.
Currently, I am using head and tail head -500000 order_sync_A.d |tail -1 head -1000000 order_sync_A.d |tail -1 head -1500000 order_sync_A.d |tail -1 .... |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
moonhk wrote:
> How to search particluar line in file ? My file have 2,600,000 line. > > Currently, I am using head and tail > head -500000 order_sync_A.d |tail -1 > head -1000000 order_sync_A.d |tail -1 > head -1500000 order_sync_A.d |tail -1 > ... > sed -n '500000p' order_sync_A.d Ed. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Mon, 30 Jul 2007 22:26:57 -0500, Ed Morton wrote:
> moonhk wrote: > >> How to search particluar line in file ? My file have 2,600,000 line. >> >> Currently, I am using head and tail >> head -500000 order_sync_A.d |tail -1 >> head -1000000 order_sync_A.d |tail -1 head -1500000 order_sync_A.d >> |tail -1 ... >> >> > sed -n '500000p' order_sync_A.d > > Ed. sed -n -e '500000{' -e p -e q -e '}' order_sync_A.d to quit as soon as you have got the line. |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On Mon, 30 Jul 2007 22:26:57 -0500, Ed Morton wrote:
> moonhk wrote: > >> How to search particluar line in file ? My file have 2,600,000 line. >> >> Currently, I am using head and tail >> head -500000 order_sync_A.d |tail -1 >> head -1000000 order_sync_A.d |tail -1 head -1500000 order_sync_A.d >> |tail -1 ... >> >> > sed -n '500000p' order_sync_A.d > > Ed. sed -n -e '500000{' -e p -e q -e '}' order_sync_A.d to quit as soon as you have got the line. |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
On 31 juil, 05:13, moonhk <moon_ils...@yahoo.com.hk> wrote:
> How to search particluar line in file ? My file have 2,600,000 line. > > Currently, I am using head and tail > head -500000 order_sync_A.d |tail -1 > head -1000000 order_sync_A.d |tail -1 > head -1500000 order_sync_A.d |tail -1 > ... Try this command : sed -n #p your_file Where # is your line number. ex : sed -n 500000p order_sync_A.d |
|
![]() |
| Outils de la discussion | |
|
|