close

Вход

Забыли?

вход по аккаунту

?

comp.unix.admin: Re: How to delete lines from beginning and end of

код для вставки
comp.unix.admin: Re: How to delete lines from beginning and end of the file
Re: How to delete lines from beginning and end of
the file
Source: http://unix.derkeiler.com/Newsgroups/comp.unix.admin/2003в€’06/0375.html
From: Gary Armstrong (garyarm_at_testedgeinc.com)
Date: 06/27/03
Date: Fri, 27 Jun 2003 07:59:40 в€’0700
Mukesh Jain wrote:
> Hi
>
> I have a automated text file generated. I want to delete 3 lines from
> beginning and 2 lines from end of the file. Is there any 'awk' or
> 'sed' command there?
Yes, but this may do:
garyarm@tegary:/home/garyarm [396] cat dat
Example: file1
clear
в€’в€’в€’в€’в€’в€’
ssvs
fasfasf
afafadfafa
afafa
afafa
afa
afafa
(7 rows effected)
garyarm@tegary:/home/garyarm [397] wc в€’l dat
14 dat
garyarm@tegary:/home/garyarm [398] head в€’12 dat | tail +6
ssvs
fasfasf
afafadfafa
afafa
afafa
afa
afafa
garyarm@tegary:/home/garyarm [399]
Re: How to delete lines from beginning and end of the file
1
comp.unix.admin: Re: How to delete lines from beginning and end of the file
If I was scripting, I'd figure the file length also
HTH
Gary
>
> Example: file1
>
> clear
> в€’в€’в€’в€’в€’в€’
>
> ssvs
> fasfasf
> afafadfafa
> afafa
> afafa
> afa
> afafa
>
> (7 rows effected)
>
>
> I want to delete first 3 lines and 2 last lines from this file. Output
> like that:
>
>
> ssvs
> fasfasf
> afafadfafa
> afafa
> afafa
> afa
> afafa
>
>
> Thanks
> Mukesh
Re: How to delete lines from beginning and end of the file
2
Документ
Категория
Без категории
Просмотров
3
Размер файла
5 Кб
Теги
1/--страниц
Пожаловаться на содержимое документа