6,7c6,8 < // Filename: [PATH][act-]1989-76[-2017-07-01][.xml] ... ie. FolderIn Prefix Stays Goes Extension < // For example, replace ‘act-‘ with ‘ACT~AUS~NSW~Y.’ and delete the date at the end ‘-2017-07-01’ – this will vary with each file --- > // Filename: act-1989-76-2017-07-01.xml > // replace ‘act-‘ with ‘ACT~AUS~NSW~Y.’ and delete the date at the end ‘-2017-07-01’ – this will vary with each file > 9,55d9 < $path=""; < $prefix="act-"; < if (isset($_GET['prefix'])) { < $prefix=str_replace("+"," ",urldecode($_GET['prefix'])); < } else if (isset($_POST['prefix'])) { < $prefix=str_replace("+"," ",urldecode($_POST['prefix'])); < } < $newprefix="ACT~AUS~NSW~Y."; < if (isset($_GET['newprefix'])) { < $newprefix=str_replace("+"," ",urldecode($_GET['newprefix'])); < } else if (isset($_POST['newprefix'])) { < $newprefix=str_replace("+"," ",urldecode($_POST['newprefix'])); < } < $stays="1989-76"; < $goes="-2017-07-01"; < if (isset($_GET['goes'])) { < $goes=str_replace("+"," ",urldecode($_GET['goes'])); < } else if (isset($_POST['goes'])) { < $goes=str_replace("+"," ",urldecode($_POST['goes'])); < } < $xgoes=""; < for ($ii=0; $ii= 'a' && substr($goes, $ii, 1) <= 'z') { < $xgoes.="[a-z]"; < } else if (substr($goes, $ii, 1) >= 'A' && substr($goes, $ii, 1) <= 'Z') { < $xgoes.="[A-Z]"; < } else if (substr($goes, $ii, 1) >= '0' && substr($goes, $ii, 1) <= '9') { < $xgoes.="[0-9]"; < } else { < $xgoes.=substr($goes, $ii, 1); < } < } < $extension=".xml"; < if (isset($_GET['extension'])) { < $extension=str_replace("+"," ",urldecode($_GET['extension'])); < } else if (isset($_POST['extension'])) { < $extension=str_replace("+"," ",urldecode($_POST['extension'])); < } < $doit=true; < $couldhave=""; < if (isset($_GET['preview'])) { < $doit=false; < $couldhave="could have "; < } else if (isset($_POST['preview'])) { < $doit=false; < $couldhave="could have "; < } 56a11 > $path=""; 59,65c14,20 < $htmlis="

Rename Report ...


Filename: act-1989-76-2017-07-01.xml ... replace act- with ACT~AUS~NSW~Y. and delete the date at the end -2017-07-01 ... this will vary with each file


"; < foreach (glob($path . $prefix . "*" . $xgoes . $extension) as $xmlfil) { < $predotxml=explode($extension, $xmlfil); < $postdotxml=explode($prefix, substr($predotxml[0],0,(strlen($predotxml[0]) - strlen($goes)))); < $renfile=$postdotxml[0] . $newprefix . $postdotxml[1] . $extension; < $htmlis=str_replace("", "
File candidate called " . $xmlfil . " found that we " . $couldhave . "renamed to " . $renfile . "", $htmlis); < if ($doit) { rename($xmlfil, $renfile); } --- > $htmlis="

XML Rename Report ...


Filename: act-1989-76-2017-07-01.xml ... replace act- with ACT~AUS~NSW~Y. and delete the date at the end -2017-07-01 ... this will vary with each file


"; > foreach (glob($path . "act-*-[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9].xml") as $xmlfil) { > $predotxml=explode(".xml", $xmlfil); > $postdotxml=explode("act-", substr($predotxml[0],0,(strlen($predotxml[0]) - 11))); > $renfile=$postdotxml[0] . "ACT~AUS~NSW~Y." . $postdotxml[1] . ".xml"; > $htmlis=str_replace("", "
File candidate called " . $xmlfil . " found that we renamed to " . $renfile . "", $htmlis); > rename($xmlfil, $renfile); 71,77c26,32 < $htmlis="

Rename Report ...


Filename: act-1989-76-2017-07-01.xml ... replace act- with ACT~AUS~NSW~Y. and delete the date at the end -2017-07-01 ... this will vary with each file


"; < foreach (glob($path . $prefix . "*" . $xgoes . $extension) as $xmlfil) { < $predotxml=explode($extension, $xmlfil); < $postdotxml=explode($prefix, substr($predotxml[0],0,(strlen($predotxml[0]) - strlen($goes)))); < $renfile=$postdotxml[0] . $newprefix . $postdotxml[1] . $extension; < $htmlis=str_replace("", "
File candidate called " . $xmlfil . " found that we " . $couldhave . "renamed to " . $renfile . "", $htmlis); < if ($doit) { rename($xmlfil, $renfile); } --- > $htmlis="

XML Rename Report ...


Filename: act-1989-76-2017-07-01.xml ... replace act- with ACT~AUS~NSW~Y. and delete the date at the end -2017-07-01 ... this will vary with each file


"; > foreach (glob($path . "act-*-[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9].xml") as $xmlfil) { > $predotxml=explode(".xml", $xmlfil); > $postdotxml=explode("act-", substr($predotxml[0],0,(strlen($predotxml[0]) - 11))); > $renfile=$postdotxml[0] . "ACT~AUS~NSW~Y." . $postdotxml[1] . ".xml"; > $htmlis=str_replace("", "
File candidate called " . $xmlfil . " found that we renamed to " . $renfile . "", $htmlis); > rename($xmlfil, $renfile); 83,88c38 < $htmlis="

Rename Run ...


Filename: act-1989-76-2017-07-01.xml ... replace act- with ACT~AUS~NSW~Y. and delete the date at the end -2017-07-01 ... this will vary with each file



< < < <
PathPrefix ... to ...
New Prefix
StaysGoes
(in terms of
its length)
Extension
Preview Only?

... to ...

Preview Only?
<

"; --- > $htmlis="

XML Rename Run ...


Filename: act-1989-76-2017-07-01.xml ... replace act- with ACT~AUS~NSW~Y. and delete the date at the end -2017-07-01 ... this will vary with each file



XML File Folder on which to perform renames:  

";