{"id":37583,"date":"2018-04-22T03:01:29","date_gmt":"2018-04-21T17:01:29","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=37583"},"modified":"2018-04-22T14:20:39","modified_gmt":"2018-04-22T04:20:39","slug":"renaming-to-aid-with-numerical-file-sorts-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/renaming-to-aid-with-numerical-file-sorts-primer-tutorial\/","title":{"rendered":"Renaming to Aid with Numerical File Sorts Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/rename_to_aid_sorting.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Renaming to Aid with Numerical File Sorts Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/rename_to_aid_sorting.jpg\" title=\"Renaming to Aid with Numerical File Sorts Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Renaming to Aid with Numerical File Sorts Primer Tutorial<\/p><\/div>\n<p>It&#8217;s not just the operating systems that throw up issues regarding file names with numerical parts to them that when displayed get sorted alphabetically, but you&#8217;d like it either &#8230;<\/p>\n<ul>\n<li>numerically &#8230; or &#8230;<\/li>\n<li>a hybrid of numerically and alphabetically<\/li>\n<\/ul>\n<p>We&#8217;re not there yet <font size=1>&#8230; but &#8220;are we there yet&#8221;, now? &#8230;<\/font> but we&#8217;re starting down the road to this with some PHP we&#8217;re developing.   This might be useful as a tool because sometimes with real work, you could be talking about hundreds of files needing renaming either to &#8230;<\/p>\n<ul>\n<li>suit some procedural (process) that is looking for the numbers to determine order, and yet uses defaulting file sorting algorithms &#8230; ie. what we are talking about today is a program to make it that both are satisfied, so long as the procedure doesn&#8217;t mind filenames being changed this way, to still work<\/li>\n<li>annoyance factor issues, the one that springs to mind for me being the assembly of some images that we use Mac OS X desktop application Preview to use to assemble into a PDF slideshow via being in the Mac OS X Finder and highlighting our files and running into the alphabetic\/numerical sort conundrum &#8230; annoyance only? &#8230; by that I mean, you can fix this at Preview, so it rates as an &#8220;annoyance&#8221; only<\/li>\n<\/ul>\n<p>What&#8217;s involved?  Lots &#8230; think of this in terms of prefixing the correct number of &#8220;0&#8221;&#8216;s (ie. zeroes) in the right place of the filename &#8230;<\/p>\n<ul>\n<li>the file extension &#8230; we decide not to cross across file extensions with our mini-renaming-rule sets<\/li>\n<li>the number of delimited sets before the period (ie. dot &#8220;.&#8221;) of the file extension &#8230; we decide not to cross across &#8220;file extension\/number of delimited sets before the period&#8221;s with our mini-renaming-rule sets<\/li>\n<li>the delimiter itself before the period (and if none, call it the period) &#8230; we decide not to cross across &#8220;file extension\/number of delimited sets before the period\/delimiter&#8221;s with our mini-renaming-rule sets<\/li>\n<li>how many &#8220;delimited sets before the period&#8221; to apply the renaming logic attempts onto &#8230; we&#8217;ve decided just the first for now<\/li>\n<li>what about non-numerical and non-delimiter characters before the period &#8230; hand me the <a target=_blank title='Take a Bex ... and ...' href='https:\/\/www.youtube.com\/watch?v=BF6ffbz70SY'>Bex<\/a>, will you?!<\/li>\n<\/ul>\n<p>Our first draft of <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/rename_to_aid_sorting.php_GETME\">rename_to_aid_sorting.php<\/a> can be tried, by you, at this <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/rename_to_aid_sorting.php\" title=\"Click picture\">live run<\/a> link.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d37583' onclick='var dv=document.getElementById(\"d37583\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/file\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d37583' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s not just the operating systems that throw up issues regarding file names with numerical parts to them that when displayed get sorted alphabetically, but you&#8217;d like it either &#8230; numerically &#8230; or &#8230; a hybrid of numerically and alphabetically &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/renaming-to-aid-with-numerical-file-sorts-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,37],"tags":[2535,2276,2147,336,1797,418,450,1615,1520,885,932,997,1872,1173,1319],"class_list":["post-37583","post","type-post","status-publish","format-standard","hentry","category-elearning","category-tutorials","tag-alphabetic","tag-delimitation","tag-delimiter","tag-directory","tag-extension","tag-file","tag-folder","tag-glob","tag-numerical","tag-operating-system-2","tag-php","tag-programming","tag-rename","tag-sort","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/37583"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=37583"}],"version-history":[{"count":3,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/37583\/revisions"}],"predecessor-version":[{"id":37596,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/37583\/revisions\/37596"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=37583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=37583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=37583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}