HemaV
July 14, 2009, 5:05am
1
I have a pattern like:
<soap>
<ABC>hello</ABC><CDE>1234444</CDE><empId>HF_T1UM_RFG></empId>
</soap>
<soap>
<ABC>hai</ABC><CDF>444445344</CDF><empId>HF/T1UM/RERFG></empId>
</soap>
Can you tell me how to search for a pattern where empId like '%T1UM%'?
do you want to replace it? or just search?
try this..
grep T1UM <pattern_file>
HemaV
July 14, 2009, 5:17am
3
How can I search specifically for empId where it has T1UM or not.
---------- Post updated at 04:17 AM ---------- Previous update was at 04:11 AM ----------
I want to search for the specific pattern for the tag empId whether it has "T1UM" or not
have you tested the code above?
if the pattern_file has "T1UM" it will display output
else you would see nothing.
HemaV
July 14, 2009, 5:27am
5
But i am unable to search directly as the same value may be present for a different tag so i wanted to search specifically for empId tag like:
grep -n '<empId>*T1UM*<\/empId>' h1.xml
How can i search for the pattern along with empId pattern?
kshji
July 14, 2009, 5:31am
6
standard regexp rules:
grep -n '<empId>.*T1UM.*</empId>' h1.xml
HemaV
July 14, 2009, 7:41am
7
If the size of one xml record is big then I am unable to get fetch the record that matches this scenario and if the size of one xml record is small then i am getting record which matches this scenario. other than grep any other command in unix which can be used?
sai21
July 14, 2009, 8:11am
8
Hope this will work out for u
grep -w "search String" file