- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- sed or awk ???
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2003 12:39 PM
02-06-2003 12:39 PM
Is there a way within sed and/or awk, (or any other command for that matter) to print certain lines within a file ??
Say in myfile I want to list lines 20 through 23 of the file only ??
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2003 12:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2003 12:52 PM
02-06-2003 12:52 PM
Re: sed or awk ???
# sed -n -e 20,23p filename
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2003 01:06 PM
02-06-2003 01:06 PM
Re: sed or awk ???
Here is one way to do it in Perl:
perl -ne 'print unless (($.<20) or ($.>23));' filename
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2003 01:12 PM
02-06-2003 01:12 PM
Re: sed or awk ???
...and if you like 'awk':
# awk 'NR >=20 && NR <= 23' filename
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2003 02:02 PM
02-06-2003 02:02 PM
Re: sed or awk ???
awk '
NR > 19 {print;}
NR > 23 {exit;)
'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2003 02:32 PM
02-06-2003 02:32 PM
Re: sed or awk ???
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2003 01:36 AM
02-07-2003 01:36 AM
Re: sed or awk ???
# perl -ne '20..23 and print' file
Enjoy, have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2003 03:30 AM
02-07-2003 03:30 AM
Re: sed or awk ???
I have taken your attachment - it is
cool&great little thing - Thanx! :)
But I try to connect to: www.wollery.demon.co.uk
to see more like that - without success.
Any information?
Regards, Stan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2003 05:46 AM
02-07-2003 05:46 AM
Re: sed or awk ???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2003 05:49 AM
02-07-2003 05:49 AM
Re: sed or awk ???
Enjoy, have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2003 06:01 AM
02-07-2003 06:01 AM
Re: sed or awk ???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2003 06:07 AM
02-07-2003 06:07 AM
Re: sed or awk ???
When youve done all, hit the (-> SUBMIT) button at the left bottom
Enjoy, have FUN! H.Merijn