Change file properties with .txt file

Post any Bulk Rename Utility support requirements here. Open to all registered users.

Change file properties with .txt file

Postby Periniquus » Tue Nov 28, 2017 12:47 am

I have about 7.8k pdf files that all have the same "date modified" and "date created" because they are all copies of an original set of pdf files with dates beginning early last year up to the present. I am able to make a list of all of the files in the "original" directory along with their file properties, and I noticed BRU is able to rename all of the files in a directory based on a given list of files.

However, I can't figure out how to apply that list renaming function to the file properties (dates). I'm terrified at this point that this may not be an available function of BRU, so please don't tell me that. Please?

Please (conditionally) advise.

Best,


Rose
Periniquus
 
Posts: 3
Joined: Tue Nov 28, 2017 12:39 am

Re: Change file properties with .txt file

Postby therube » Tue Nov 28, 2017 2:13 am

Not really following what you're looking to do?
Could you provide some specific examples?

---

Anyhow, it looks like BRU can only change a files date/time in conjunction with a rename operation.
So if you only are looking to change date/time, BRU may not be feasible.
(I don't see a way to perform a "null" operation, while allowing the date/time change.
You could do something like, preface the files with some unique string, then go back afterwards & remove that same string.)


Might have a look at Nirsoft's BulkFileChanger.

It (as does BRU) can handle large numbers of files with relative ease.
It has a GUI, but can also be run from a command-line.
It does not support "file lists" as BRU does, but that may or may not matter, depending on just what you're looking to do.

Disregard all of that, BRU can do it alone.
(I have no idea what I was doing the first time when I wrote that.)
therube
 
Posts: 313
Joined: Mon Jan 18, 2016 6:23 pm

Re: Change file properties with .txt file

Postby Periniquus » Tue Nov 28, 2017 9:39 am

Your post is terribly confusing - it's probably just me - but if I understand correctly, your quote appears to be your original post, and your current post is, essentially, edited? If I don't understand correctly, let me try again tomorrow morning.

I was hoping to be able to attach screenshots in my first post, but I didn't have time. I was too tired to do it now, but I guess I started having fun with BBCode:

... where orig = original and ocr = 'copy'...

    Filename...........Created..........Modified
  • thisorig.pdf..........7/1/16............7/14/16
  • thisocr.pdf.........11/27/17..........11/27/17
  • thatorig.pdf.........7/2/16..............7/2/16
  • thatocr.pdf.........11/27/17..........11/27/17
... needs to become...

    Filename...........Created..........Modified
  • thisorig.pdf..........7/1/16............7/14/16
  • thisocr.pdf...........7/1/16............7/14/16
  • thatorig.pdf.........7/2/16..............7/2/16
  • thatocr.pdf..........7/2/16..............7/2/16
... assuming thisorig and thatorig actually have the same filename.

I'll do better in the morning. Promise.

The "file lists" support is absolutely essential - it is actually the only reason I even thought to use BRU, as I've never seen such a feature before. I export file properties into an Excel document (which I then convert to csv/txt) and I'm desperately hoping to use that in BRU. I'm not sure how exactly the file list needs to be formatted, but I'm good at all that so I'm not worried about conforming.

So I can separate the originals from the OCR copies and then save the originals as the file list with the correct date properties, then use that to fix the date properties in the OCR copies so I have accurate file properties and OCR in my final product - that is my goal.

I feel like the tables could have been better arranged for clarity, too. Sorry.. :<


R.
Periniquus
 
Posts: 3
Joined: Tue Nov 28, 2017 12:39 am

Re: Change file properties with .txt file

Postby Periniquus » Wed Nov 29, 2017 3:26 am

Sorry I'm late.

I pretty much have everything set up for BRU to "rename" the file properties:
https://drive.google.com/file/d/1i3N0mjrvl99um-7LX70sjWcQQH2E_Dwo/view?usp=sharing

I have both sets of files and the text file list, but the more I look at it the more it seems like BRU can't actually do this. I guess I'll head over to suggestions. Unfortunately, it didn't look like Bulk File Changer was able to do it, either..

Thank you for your help, therube. Maybe someone will have another suggestion for me - I'm open to alternative methods, too. Right now I'm trying to figure out how to make Acrobat behave and OCR in an appropriate manner. This won't happen, though, so suggestions are definitely welcome!


R.
Periniquus
 
Posts: 3
Joined: Tue Nov 28, 2017 12:39 am

Re: Change file properties with .txt file

Postby therube » Wed Nov 29, 2017 2:39 pm

So lets get back to what you want to do...

You have originals
You have OCRs

The OCRs are dated currently

You want the OCRs to be dated back to the same date of the originals?

---

Yes, I was quoting myself, above.

---

I'll often modify files but then "re-date" (touch) them back to the original source file's date.
For 1 at a time usage, I use:

SETTIME.BAT:
Code: Select all
@ECHO OFF

ECHO  SETTIME  sets a file's date to the "same" file, named "abc"
ECHO  a sort of more current variation of my old ancient DOS settime program
ECHO.
ECHO  therube 02/20/2015
ECHO.
ECHO  File to change the date of:  %1

FOR   %%i in (%1) do  SET   BASENAME=%%~dpiabc
ECHO  reference file (aka "abc"):  "%BASENAME%"
ECHO.
ls -l %1
ls -l "%BASENAME%"
ECHO.

PAUSE

touch %1 --reference="%BASENAME%"
ls -l %1

PAUSE
EXIT


touch, is the unix touch command
ls, is the unix ls commad (akin to DIR)

By convention, when I do this, I make a copy of the source, naming it "abc".
So I have my source file, & a file named abc.
They're the same, same file date/time.

I make my changes to source, & when done, I run my SETTIME batch file, from my file manager (or Windows Explorer) [via SendTo in right-click context menu] which sets the (at that point, modified, so currently dated) source back to its original date.

Then I delete the 'abc' file.

---

I believe that I have something where I've done bulk date changes too, I'll have to look later.

But general idea is:

sourcedir
modifieddir

for i in sourcedir/%i do SETTIME modifieddir/%1

---

orig file is DS11..., abc is a copy of that, both have same date
Code: Select all
Directory of C:\TMP\SEA\pdf

11/29/2017  08:31 AM    <DIR>          .
11/29/2017  08:31 AM    <DIR>          ..
01/11/2017  12:04 PM            98,256 abc
01/11/2017  12:04 PM            98,256 DS11_Complete.pdf



here i've modified DS11..., so its date changed
Code: Select all
Directory of C:\TMP\SEA\pdf

11/29/2017  08:31 AM    <DIR>          .
11/29/2017  08:31 AM    <DIR>          ..
01/11/2017  12:04 PM            98,256 abc
11/29/2017  08:32 AM            98,256 DS11_Complete.pdf



after running SETTIME (slightly modified), DS11... again has its original date (& in this case, I also forced the time-part to be 2:01pm)
Code: Select all
Directory of C:\TMP\SEA\pdf

11/29/2017  08:31 AM    <DIR>          .
11/29/2017  08:31 AM    <DIR>          ..
01/11/2017  12:04 PM            98,256 abc
01/11/2017  02:01 PM            98,256 DS11_Complete.pdf



SETTIME in action.
#1, the files after having modified DS11...
#2, now showing DS11 with its time set back to its original date

Image
therube
 
Posts: 313
Joined: Mon Jan 18, 2016 6:23 pm

Re: Change file properties with .txt file

Postby therube » Wed Nov 29, 2017 5:33 pm

I believe that I have something where I've done bulk date changes too, I'll have to look later.

But general idea is:

sourcedir
modifieddir

for i in sourcedir/%i do SETTIME modifieddir/%1


Seems at the time, I used the old DOS command, SETTIME (aka SAMEDAT).

Code: Select all
SAMEDATE -- V1.2 Public Domain Utility
David Kirschbaum, Toad Hall
SAMEDATE -- call error, calling sequence is:

       SAMEDATE file1 file2

Action is to give file2 the same date as file1


With a batch file that looked like:
Code: Select all
settime 0bid.zip ..\0bid.zip
settime 0xxx.bat ..\0xxx.bat
settime add ..\add
settime ang-dms ..\ang-dms
settime angle ..\angle
settime angle-bu ..\angle-bu
settime ap11s ..\ap11s
settime ap3as ..\ap3as
settime aptf ..\aptf
settime area2 ..\area2
settime area3 ..\area3
settime areat ..\areat
settime ashlabel ..\ashlabel
settime ashlabel.s ..\ashlabel.s
settime ashltrhd ..\ashltrhd
settime baddept ..\baddept
settime baddept1 ..\baddept1
settime baddept2 ..\baddept2
settime baddept3 ..\baddept3
settime baddept4 ..\baddept4
settime baddept5 ..\baddept5
settime balsheet ..\balsheet
settime bidderf ..\bidderf
settime biddscr ..\biddscr
settime bidfile ..\bidfile
settime bidinfo ..\bidinfo
settime bidlst.zip ..\bidlst.zip
settime bidlst2 ..\bidlst2
settime bidscrn ..\bidscrn
settime bidscrn1 ..\bidscrn1
settime bobkeys ..\bobkeys
settime budgetf ..\budgetf
settime budgetm ..\budgetm
settime cal ..\cal


Very basic, just iterate over a set of files, simply setting the date of the file in the parent directory to the same named file in the current directory.
therube
 
Posts: 313
Joined: Mon Jan 18, 2016 6:23 pm


Return to BRU Support


cron