I've been stumped on finding a way to find and replace characters based on position. Basically what I am looking to do it go into a document and replace
<gco:DateTime>2016-04-20T11:27:34.8677919-06:00</gco:DateTime>
With
<gco:DateTime>2016-04-20T11:27:34</gco:DateTime>
Everything after the decimal character must be deleted. The issue is, this is for multiple time stamps in XML files, and each of these time stamps are totally different. I've read a bit on regex and it seems like a possible method. Any help would be greatly appreciated.
Edit Example of XML file format:
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type='text/xsl' href='http://ngis/ngis/metadata/StyleSheet/xslt/nGIS_Metadata.xslt'?>
<gmd:MD_Metadata xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:gmx="http://www.isotc211.org/2005/gmx" xmlns:gts="http://www.isotc211.org/2005/gts" xmlns:gfc="http://www.isotc211.org/2005/gfc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gss="http://www.isotc211.org/2005/gss" xmlns:gsr="http://www.isotc211.org/2005/gsr" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gmi="http://www.isotc211.org/2005/gmi" xmlns:gmd="http://www.isotc211.org/2005/gmd">
<gmd:fileIdentifier>
<gco:CharacterString>BF244A7CB62491BC74B001BE5DEAA213AAFB9DBA</gco:CharacterString>
</gmd:fileIdentifier>
<gmd:language>
<gco:CharacterString>English</gco:CharacterString>
<gmd:date>
<gco:DateTime>2016-04-20T11:27:34.8677919-06:00</gco:DateTime>
</gmd:date>
@Parfait