![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Shell script to search for text in a file and copy file | imeadows | UNIX for Dummies Questions & Answers | 9 | 3 Weeks Ago 06:12 PM |
| How to remove only html tags inside a file? | btech_raju | Linux | 2 | 11-23-2007 09:25 AM |
| search for the contents in many file and print that file using shell script | cdfd123 | Shell Programming and Scripting | 3 | 10-07-2007 07:17 PM |
| How to split file by tags inside file? | spookyrtd99 | Shell Programming and Scripting | 1 | 07-30-2006 09:50 PM |
| How to search a pattern inside a zipped file ie (.gz file) with out unzipping it | senraj01 | Shell Programming and Scripting | 2 | 04-26-2006 01:32 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Search for xml tags in a file
Hi,
I need to search for a pattern like : <A:UserAttr Name="ACTIVITY_ID"> <A:Value>1111120</A:Value> </A:UserAttr> Let us the there is a dir /tmp that contains 5 xml file. each of them multiple above tags in the file. If found all the three line would be together. Now I have to search for that pattern and if found i am supposed to extract the value i.e 1111120 write to another file. Is it possible to do this. If so, how? |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
See if this helps a little:
Code:
sed -n '/A:UserAttr Name="ACTIVITY_ID"/,/A:UserAttr/p' filename |
|
#3
|
|||
|
|||
|
Thanks, It works!!
|
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|