Re: Removing every other word from a text file
From: Jan van den Broek (fortytwo_at_xs4all.nl)
Date: 04/29/03
- Next message: Chris F.A. Johnson: "Re: Removing every other word from a text file"
- Previous message: Andy Cheung: "Removing every other word from a text file"
- In reply to: Andy Cheung: "Removing every other word from a text file"
- Next in thread: Chris F.A. Johnson: "Re: Removing every other word from a text file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Tue, 29 Apr 2003 15:03:48 MET
29 Apr 2003 04:34:20 -0700
andycheung2000@hotmail.com (Andy Cheung) schrieb:
>Could someone please help me with editing a text file? I have a large
>text file in which I need to remove every other word. That is, word
>numbers 2,4,6,8,10 etc need to be deleted. Is there a Vi command or
>some other command I can use to do this easily?
You might try someting like:
sed 's/[ <TAB>]/<CTRL-V><CTRL-M>/g/'|awk 'NR%2 {print $0}'|fmt
This is untested, but it might be a starting point.
--
Jan van den Broek balglaas@xs4all.nl
===============================================================================
"Het ene gaat altyd in de richting van het andere",
Johan Cruyff 3-VIII-'92
- Next message: Chris F.A. Johnson: "Re: Removing every other word from a text file"
- Previous message: Andy Cheung: "Removing every other word from a text file"
- In reply to: Andy Cheung: "Removing every other word from a text file"
- Next in thread: Chris F.A. Johnson: "Re: Removing every other word from a text file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|