![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX and Linux Applications Discuss UNIX and Linux software applications. This includes SQL, Databases, Middleware, MOM, SOA, EDA, CEP, BI, BPM and similar topics. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| make multiple line containing a pattern into single line | VTAWKVT | Shell Programming and Scripting | 13 | 12-04-2008 06:40 PM |
| Korn pattern-list with a variable | partchimp | Shell Programming and Scripting | 2 | 03-26-2008 02:12 PM |
| sed - Replace Line which contains the Pattern match with a new line | kousikan | Shell Programming and Scripting | 2 | 03-24-2007 07:24 AM |
| List files that do not match the search pattern | olapxpert | IP Networking | 1 | 04-14-2005 02:37 PM |
| pattern list? | jelizondo1010 | UNIX for Dummies Questions & Answers | 1 | 04-20-2001 08:55 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Need to list pattern only not containing whole line
I am searching a pattern item_id>000111111</item_id> in an XML file.
More than one occurance are there for this patter in a single line. I have tried awk '/item_id/,/item_id/' tpnb1.txt>abc.txt Full lines containg pattern are coming. I need only list of 000111111. |
|
||||
|
A quick and dirty solution using perl:
Code:
perl -ne 'm,<asd>(.+)</asd>, and print "$1\n" ' file.xml Code:
sed -ne 's,<asd>\(.*\)</asd>,\1,p' file.xml <item_id>000111111</item_id><item_id>000111111</item_id> Then it gets tricky. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|