- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: find and replace string in xml files
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
08-14-2008 02:50 AM
08-14-2008 02:50 AM
I have 5 xml contains string:
Values of tags may differ in files. I want the output
like (after desimal only 2 zeros)
We need program or command that will go each file find these tags(Easting and Northing and update the entry).
Can some one help me in this regard?
Thanks..
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2008 03:51 AM
08-14-2008 03:51 AM
Re: find and replace string in xml files
sed '/
repeat by replacing "East" with "North" and keeping track of the intermediate files. If you have more lines that start and end the same way but don't have numbers in them you need to narrow down the search string to numbers only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2008 11:29 PM
08-14-2008 11:29 PM
Re: find and replace string in xml files
sed -e 's:\(
-e 's:\(
If you want to change all numbers to have .00, that's easier.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2008 09:59 PM
08-17-2008 09:59 PM
Re: find and replace string in xml files
Many thanks,
It is looks quite ok but what it is doing is :
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 05:18 AM
08-18-2008 05:18 AM
Re: find and replace string in xml files
Oops, I didn't notice you multiplied by 10.
sed -e 's:\(
-e 's:\(
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 05:37 AM
08-18-2008 05:37 AM
Re: find and replace string in xml files
It is a kind of "patch work". But this is what comes to my mind now - and it works. Try with different source files to make sure the result is correct:
cat filename
sed 's/\.//g' filename|awk -F"0
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 04:25 PM
08-18-2008 04:25 PM
Re: find and replace string in xml files
sed -e 's:\(
-e 's:\(
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2008 11:20 PM
08-18-2008 11:20 PM
Re: find and replace string in xml files
Thanks a lot it works for me. But i struck in one place where i want to regular expression with if condition like
var=13
if [ $var [1-9]0 ] ; then
echo " required no contains first digit between 1-9 and followed by 0 "
else
echo " num does not follow patterns "
fi;
Please suggest correct way to right this.
Thanks a lot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2008 12:18 AM
08-19-2008 12:18 AM
SolutionTo handle file matching patterns you can do:
for var in 13 20; do
if [[ "$var" = [1-9]0 ]]; then
echo "$var: matches pattern"
else
echo "$var: doesn't match"
fi
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2008 12:23 AM
08-19-2008 12:23 AM
Re: find and replace string in xml files
Thanks a ton,
It is working.
Thanks