- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script Help
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
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
01-10-2003 02:30 PM
01-10-2003 02:30 PM
I want to delete line _____ from the following output.
ACTUATE_NETDATA
INTDATA1_INTDAT
___________
hncprod_group4
intdata1_full_h
result i'm looking for.
ACTUATE_NETDATA
INTDATA1_INTDAT
hncprod_group4
intdata1_full_h
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2003 02:32 PM
01-10-2003 02:32 PM
Re: Script Help
One way to do it is to use 'grep':
grep -v '_____' inputfile
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2003 02:33 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2003 02:41 PM
01-10-2003 02:41 PM
Re: Script Help
perl -ne 'print unless /_____/;' inputfile
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2003 02:44 PM
01-10-2003 02:44 PM
Re: Script Help
sed '/_____/d' inputfile
Work
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2003 02:54 PM
01-10-2003 02:54 PM
Re: Script Help
I'd use 'sed', but tighten the matching:
# sed -e '/^_*$/d' filename
Hence lines consisting *only* of underscore characters...
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2003 12:31 PM
01-11-2003 12:31 PM
Re: Script Help
# perl -ne'/^_+$/ or print'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2003 12:44 PM
01-11-2003 12:44 PM
Re: Script Help
Someday I've got to sit down and really learn Perl regular expressions. It just won't stick in my mind, kind of like all that English grammar I couldn't get to stick in my mind back in school. It seems to me that regular expressions ranks right up there with gerunds and past participles. Ouch! :)
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2003 07:08 PM
01-12-2003 07:08 PM
Re: Script Help
Yes, you are correct. I did not mean to delete *empty* lines and *should* have written:
# sed -e '/^__*$/d' filename
...THAT IS, *two* underscore characters preceeding the asterisk so that the match is *one* underscore anchored at the line's start, followed by *zero or more* underscore's anchored to a newline.
The extended regular expression:
^_+$
understood by 'perl', works nicely too with 'egrep' ['grep -E'] or with 'awk' but not with 'sed'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2003 11:52 PM
01-12-2003 11:52 PM
Re: Script Help
FWIW The regex bible from Jeffrey Friedl (http://www.oreilly.com/catalog/regex/) has nice comparison tables for the most common filter programs in what regex flavour they accept.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2003 06:28 AM
01-13-2003 06:28 AM
Re: Script Help
Your points are well taken. Ah, yes, to GNU or not to GNU...a good subject for discussion onto itself.
Thanks for the link. As you are probably aware, the book has a 2nd edition which certainly appears to be worth the read:
http://www.oreillynet.com/pub/a/network/2002/07/15/regexp.html
With warmest regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2003 06:56 AM
01-13-2003 06:56 AM
Re: Script Help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2003 07:17 AM
01-13-2003 07:17 AM
Re: Script Help
You should take care of this:
This member has assigned points to 13 of 86 responses to his/her questions.
You can find your previous posts in your profile:
http://forums.itrc.hp.com/cm/TopSolutions/1,,CA485690!1!questions,00.html
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2003 07:23 AM
01-13-2003 07:23 AM