- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: find and replace xml tag value in file extende...
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
Discussions
Discussions
Forums
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
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
тАО08-16-2009 09:08 PM
тАО08-16-2009 09:08 PM
I am just extending the thread started by diwakar with my query.
James R. Ferguson have replied that
# perl -pe 's{(
By using this perl code we can find and replace partciular tab value in xml file. This is working fine for me also. I want to add some more check like it should also replace url which are staring with https/HTTP/HTTPS(Case sensitive..) so can any one help me how to add OR condtion in this?
Thanks
Gopi
Solved! Go to Solution.
- Tags:
- sed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2009 02:48 AM - edited тАО08-28-2011 08:54 PM
тАО08-17-2009 02:48 AM - edited тАО08-28-2011 08:54 PM
Re: find and replace xml tag value in file extended
>I am just extending the thread started by diwakar with my query.
It would have been helpful to provide the URL:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1351538
With sed, you just provide two "-e 's///g'".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2009 03:00 AM
тАО08-17-2009 03:00 AM
Re: find and replace xml tag value in file extended
cat your_file | sed 's/HTT/HTTPS/'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2009 03:45 AM
тАО08-17-2009 03:45 AM
Re: find and replace xml tag value in file extended
I will prefer to update perl code , acuatlly i have many xmls that has one tab called which may contains
Hope James R. can help me in this regard if he is able to see my case.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2009 06:43 AM
тАО08-17-2009 06:43 AM
Re: find and replace xml tag value in file extended
perl -pe "s/(
tURLprefix>)/$1www.dummy.com$3/g" test.txt
(http|https) can be extended just by adding pipes and the keyword.
If you by some reason would want to match the old url as well you can remove ?: in (?:[^<]+) and $3 will become that address ($4 will be
Output looks like this.
V0001> perl -pe "s/(
tURLprefix>)/$1www.dummy.com$3/g" test.txt
Best regards
Fredrik Eriksson
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2009 07:03 AM
тАО08-17-2009 07:03 AM
Re: find and replace xml tag value in file extended
It is giving me error like :
sh: 1: Parameter not set.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2009 07:18 AM
тАО08-17-2009 07:18 AM
Solution> sh: 1: Parameter not set.
Change the double quotes that enclose the command line script to single ones when you run a Perl script from a Unix shell:
# perl -e '...'
...instead of:
# perl -e "..."
...which is what silly Windows wants.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2009 07:37 AM
тАО08-17-2009 07:37 AM
Re: find and replace xml tag value in file extended
Many thanks it is resolved now.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2009 02:29 PM
тАО08-17-2009 02:29 PM
Re: find and replace xml tag value in file extended
But yeah, single quotes :)
Best regards
Fredrik Eriksson