Afficher un message
Vieux 17/08/2006, 19h07   #5
Bill Marcum
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Need to delete the next line in a file

On 17 Aug 2006 09:39:54 -0700, heynetboy
<heynetboy@gmail.com> wrote:
> Hello -
>
> I need to find a line in a file that starts with a % and then delete
> the very next line leaving the line that starts with the %. I can find
> the line by using ^% but no idea how the delete the next line.
>
> Any ideas how to do this?
>
> HNB
>

awk '{print} /^%/{getline}'

What if two or more consecutive lines begin with %?

--
Graduate students and most professors are no smarter than undergrads.
They're just older.
  Réponse avec citation
 
Page generated in 0,04865 seconds with 9 queries