Re: only output the nth line

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 12 May 2010 18:58:56 +0200
Jozsi Vadkan <jozsi.avadkan@xxxxxxxxx> wrote:

> I have a file:
> 
> cat file.txt
> daemon
> 1):
> 596
> 0
> 0
> 1
> 0
> 0
> bin
> 2):
> 12
> 0
> 0
> 1
> 0
> 0
> sys
> 3):
> 0
> 0
> 0
> 0
> 0
> 0
> 
> 
> 
> And i want to only output the first, second, and fourth line to another
> file.
> 
> The:
> 
> sed -n '1,2p;4p' file.txt
> 
> doesn't work.
> 
> What magic do i need for it? :D
> 
> Thanks..:\
> 
> -- 
> users mailing list
> users@xxxxxxxxxxxxxxxxxxxxxxx
> To unsubscribe or change subscription options:
> https://admin.fedoraproject.org/mailman/listinfo/users
> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

You can try some awk, methinks; I don't remeber how
to do it, but I say it's a good direction.
-- 
Rares Aioanei <fedora.listen@xxxxxxxxx>
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux