- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- mulit line pattern?
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-13-2003 04:12 AM
02-13-2003 04:12 AM
I need extract the complete line from the file as below: (example.dat)
...
abc=123 456 FFF 789 HHH 000 KKK
...
Only the "abc=123 456 FFF \" could be gotten with " grep abe example.dat" but the rest part were lost.
Could we use the normal script to handle such cases?
Thanks
Jack
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2003 04:15 AM
02-13-2003 04:15 AM
Re: mulit line pattern?
The "FFF" and "HHH" were followed by the "\" character.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2003 04:25 AM
02-13-2003 04:25 AM
Re: mulit line pattern?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2003 05:16 AM
02-13-2003 05:16 AM
Re: mulit line pattern?
It does't work well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2003 05:21 AM
02-13-2003 05:21 AM
Re: mulit line pattern?
Can you attach the file - not sure what you mean by the "\" character, as that should grep with no problems.
rgds, Robin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2003 08:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2003 08:43 PM
02-13-2003 08:43 PM
Re: mulit line pattern?
Wonderful!The awk script you provided works well.
The output was :
abc 123 456 FFF 789 HHH 000 KKK UUU
Robin,
I've attached the example.dat and please review it.
Thank all of you!
Cheers
Jack
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2003 01:39 AM
02-14-2003 01:39 AM
Re: mulit line pattern?
Here's a perl script to "grep" with continuation characters:
===============
#!/usr/bin/perl
$string=shift;
open FH,shift;
while (defined($line=
chomp $line;
if ($line=~s/\\\s*$//){
$line.=
redo unless eof(FH);
}
print "$line\n" if ($line=~/$string/);
}
================
so to run it:
% scriptname searchstring filename
rgds, Robin