Admin stuff:

Version 2019_0815 #ChangeHistory #Liscense #ToDo

Contents:

#BadName Find long or bad names widows chokes on

#FrontDate Put a stable date in front or back of filename

#FuzzyName Change any filename text A to text B

#ManualName Work changes in table then run

#DeleteEmptyFolders

#NewVersion Move your office files to newest format before its too late

#RecoverEmbeds embeds

#MakeText txt

#Archive pdf

Info:

Runs under restrictive corporate policies. Open source. Public domain.

This macro enabled document has a lot of macros in it. Pages and pages. Why so many? They all use the same file system interface and they all do things you need to dock a large library. Putting them in pages of tables keeps development simple.

Filenames invalid to windows are skipped. You can fix filenames in Linux

All macros are background in . DOUBLE CLICK to run

BadName Path, file, name repair

read folder	D:\0\01_in
Look for folders and files with invalid characters. You will get a report. BadName.txt in 0scratch folder Windows wont let you touch the files. You will have to mount in Linux to fix. This check is embedded in other apps also. It has to be.
Closed for renovation Look for specs (path and name) that are too long.
Index the directory and stop. index files will be in 0scratch for audit.

FrontDate ISO8601 date name

Pre-existing date, if found, will be compared to dos date and the earliest used.

read folder	E:\G_tdr_60B\bkp_60B\ptr
front date file. .doc .dot .docx .docm .dotm .pdf .xls .xlsx .xlsm .ppt .pptx .pps .wbk .mpp .msg..
FrontFileMso and remove 2nd date
front date FILE. textish files only
front date FILE. picture files only
front date FOLDER
date on back of file name. Run front date first.
Time off every date/time combo except txt. Marks duplicates if older.
Time off every date/time combo. Marks duplicates if older.
No date. Removes date/time.

FuzzyNameChange

in line 3 and lower, any text found in col1 will be replaced by text in col2

make as many lines as you need.

read folder	E:\G_tdr_60B\bkp_60B\ptr
vvvv old vvvv	vvvv new vvvv
ptr	PTR0

Design_Direction_Meeting	DsgnDir
Design Direction Meeting	DsgnDir
PAX_Board_PTRB_PTRReport	PtrB

Manual Name Change

Brings up a table filled with selected names

Columns 2 and 3 are identical.

Change names in column 3 any way you can. Auto, manual, macro.

Run CheckDups to fix duplicate names in column 3

Run CHANGE to make the name changes

read folder	I:\lib_video\DirtyDancing_files
Scrub file names not in subdirectories
Scrub folder names not in subdirectories
Scrub file names also in subdirectories
Scrub folder names also in subdirectories
Check scrubbed list for duplicated\s
Make the scrubed name changes

Thin it keep newest / oldest 1 . runs on end dates only.

read folder	D:\A\A4_design\SSD\SSDP\dar_ssdp\2010_dar
leave 1 newest file
leave 1 newest 1 oldest files

Delete Empty Folders

read folder	E:\home\pub\1_plan

NewVersion Move what you can to xls. Move what you cant to quarentine.

read folder	E:\E_tdr\bkp_xref\DtOt\2000_
doc dot mht wbk. dot, doc w/macro will save as docm. dot w/no macro will save as docx.
xls. xls w macro will save as xlsm
ppt pps ADD MACRO DETECTOR
htm html. WARNING HTM can be code or RTF alternate. If you convert it you broke it. Pre-filtering into *.zip can help
msg. Converts to txt and recovers embeds. Requires Outlook. Run first. Run repeat until no new found.
Special. Migrate doc to rtf to docx. For doc that refuses to save as docx.
Special. open a blank doc and put the crapdoc inside it

RecoverEmbeds docx rtf pptx xlsx

MakeText make searchable text copy Only do ISO dated files

no htm. htm migrates to pdf

read folder	D:\x
write folder	D:\y
docx
xlsx
pptx
pdf (need to id scan pdf to skip?)
rtf
txt, csv binary copy unmodified. They are already text.

D:\A\A4_design\Mssn_surf D:\txt_doc\A\A4_design\Mssn_surf

Archive move to pdf. include macros and formulas.

REQUIREMENT

1 dos date

2 format currency

3 valid characters

4 path length

1 dos date

The DOS date is unstable for a number of reasons. All of them avoidable. The priority at Microsoft is too low to register. It is a show stopper when you are trying to manage decades of major program technical records.

Instabilities include:

01) Epoch leap (leap years, leap seconds)

02) Epoch localization (zones and seasons)

03) Mounting variation

04) Forced migration

05) FAT and NFS corruption

06) Undefined definition

This app is a workaround that hard codes a stable date into the file name

2 format currency

Oldest file formats have been abondoned, mainly by word and popo. There was no warning and if you did not already migrate, you lost your data. This app filters out abandoned formats to be fixed manually. you need an old version of office to do this.

The MS position on this appears to be that no one needs old data. This could be evidence that MS Office formats are inappropriate for archive. Think about RTF, PDF, CSV etc if you really want it available years from now

3 valid characters

Invalid characters creep in from unix (incl linux), maybe some web browsers, maybe vba.

Can only be fixed in unix? This app filters aside.

A complicating factor is a slight difference in valid characters by excel from MS nominal.

4 path length

Windows is happy to build paths as long as you like and then refuse to work with them because they are too long. Really? Yes.

Change History

date / version
2019_0815	make file loop a service Split and regroup across multiple tools. SubAtomic, FileSearch. upgrade fail log to presort
2019_0501	Clean up readables and publish
2019_0315	Last dev version

To Do

embedded files in all possible ext ?=no

.rtf .pdf? .htm? .msg .docx .pptx .xlsx

need to give each error type its own dir. especially badname.

turn countdowns back on

Fix long file names

migrate htm and mht to pdf. Extract attach.

migrate msg to txt. Extract attach.

migrate *.dot to *.dotm

fail folders for move uplev dup

Source locus. high count of off nominal extensions

gallery locus. High count of known media formats

back name files

back name folders

terse names

flatten embeds

long names

bad names

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Start Of License Statement

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

End Of License Statement

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx