Old skills
May. 23rd, 2026 07:55 pmI recently decided to clean up some files. Specifically some video files. A long time ago, I'd been converting some files from their existing formats (which didn't play correctly on some devices) to .mp4 files.
Thing is, I'd converted a bunch but hadn't gotten around playing the converted version to check that the new versions worked.
So I have an unknown number of supposedly fixed files, and the same number of ol.d files that need to be replaced.
But since I'd been converting files from several different directories, pairing things up is more than a bit complicated The one thing I *do* know is that the new versions have the same name as the old versions, but with .mp4 added to the old file name.
So "all" I have to do is get a listing of *all* the files on the disk in question (almost 4 TB) and look for files with almost the same name. No problem at all, right?
Fortunately, since I use TCC LE (a distant descendant of 4DOS) generating the list of files was easy.
dir /s /h /k /m /a:-d > vlist.txt
Going thru the list to strip out irrelevant files is a bit more complex. "All" I needed to do was read thru that file and output a list of files that didn't have unwanted extension (.txt, .p3, etc)
This isn't that hard to do. A simple basic program can do it. Though for simplicity, it's easier to just strip out one extension at a time and then edit and rerun to remove the next one.
But when I went to do it, I realized just how *long* it'd been sign I'd done any programming. (twenty plus years?) Took me a couple of hours to find where I'd squirreled away all the programing languages.
And today It took me a while to remember the syntax for some of the commands.
Finally got it running though.
10 OPEN "x:\vlist.txt" FOR INPUT AS #1
20 OPEN "x:\vlist1.txt" FOR OUTPUT AS #2
30 LINE INPUT #1, A$
40 IF NOT RIGHT$(A$,4)=".EML" THEN PRINT #2, A$
50 IF NOT EOF(1) THEN 30
60 CLOSE #1:CLOSE #2
just run it, delete vlist.txt. Rename vlist1.txt to vlist.txt. Edit line 40 for the new extension. Rinse and repeat. File's down to about a third of the starting size. Hopefuly not too many more passes
Thing is, I'd converted a bunch but hadn't gotten around playing the converted version to check that the new versions worked.
So I have an unknown number of supposedly fixed files, and the same number of ol.d files that need to be replaced.
But since I'd been converting files from several different directories, pairing things up is more than a bit complicated The one thing I *do* know is that the new versions have the same name as the old versions, but with .mp4 added to the old file name.
So "all" I have to do is get a listing of *all* the files on the disk in question (almost 4 TB) and look for files with almost the same name. No problem at all, right?
Fortunately, since I use TCC LE (a distant descendant of 4DOS) generating the list of files was easy.
dir /s /h /k /m /a:-d > vlist.txt
Going thru the list to strip out irrelevant files is a bit more complex. "All" I needed to do was read thru that file and output a list of files that didn't have unwanted extension (.txt, .p3, etc)
This isn't that hard to do. A simple basic program can do it. Though for simplicity, it's easier to just strip out one extension at a time and then edit and rerun to remove the next one.
But when I went to do it, I realized just how *long* it'd been sign I'd done any programming. (twenty plus years?) Took me a couple of hours to find where I'd squirreled away all the programing languages.
And today It took me a while to remember the syntax for some of the commands.
Finally got it running though.
10 OPEN "x:\vlist.txt" FOR INPUT AS #1
20 OPEN "x:\vlist1.txt" FOR OUTPUT AS #2
30 LINE INPUT #1, A$
40 IF NOT RIGHT$(A$,4)=".EML" THEN PRINT #2, A$
50 IF NOT EOF(1) THEN 30
60 CLOSE #1:CLOSE #2
just run it, delete vlist.txt. Rename vlist1.txt to vlist.txt. Edit line 40 for the new extension. Rinse and repeat. File's down to about a third of the starting size. Hopefuly not too many more passes