Jump to content
Sign in to follow this  
krpdesign

program to compare txt list to actual files?

Recommended Posts

we have a massive project in that has to be rendered into a ton of different versions. there's literally more than 18,000 files that I need to deliver at the end, and im trying to find a program or something to let me know what i've already done and what is missing. i was using an excel sheet to just manually mark the ones that are done, but that's proving to be really time consuming.

 

does anybody know of a program that i can use to perhaps compare a TXT document to the files in a folder and have it tell me what is not there or update the TXT file? or maybe something else along those lines? is there anything in automator that can help me? im open to just about anything at this point. my brain is starting to hurt from thinking about it too much. thanks in advance.

Share this post


Link to post
Share on other sites

you could definitely do this with a shell script in linux or os x... or using cygwin in windows. it would be pretty easy to loop through each line of a text file, see if there's a match in the contents of a directory, and throw and error if there isn't.

Share this post


Link to post
Share on other sites

In Unix you could do this:

 

Navigate to the directory in question. And use:

 

ls >dirContents.txt

 

This would create a txt file with the directory contents. Then use:

 

diff [file1] [file2]

 

This will show the difference between the two files. You could even do:

 

diff [file1] [file2] >difference.txt

 

To output a txt file that with the differing contents.

Share this post


Link to post
Share on other sites

You might want to try sdiff instead of diff to spit out just the difference.

With that many files, it may be a bitch to sift through.

 

sdiff -s file1.txt file2.txt

 

to output to a file do:

 

sdiff -s file1.txt file2.txt > diff.txt

Share this post


Link to post
Share on other sites

Waaaaait a sec. Does this also answer the eternal question of 'how the hell do I know which frames in this image sequence are missing?' dilemma? Write the directory contents to a text file, import to Excel, make a column of numbers, see where they diverge. What I'm saying seems like overkill until you have a 2,500 frame render that's missing 13 frames and the missing frames are scattered all over that range.

Share this post


Link to post
Share on other sites

^^^ seems like this would be the trick for that, but I don't think you even need excel.

 

to Graymachine, thank you so much!!!! you have no idea (maybe you do) how much pressure this is taking off me, not to mention saving probably 2 full days of work

Share this post


Link to post
Share on other sites

The thing is, for what I'm talking about, you'd have to have a list to compare to. That's where the Excel comes in, but I bet there's a Terminal way also. I'm also assuming there isn't a really basic way in AE to show which frames in a sequence are missing...

Share this post


Link to post
Share on other sites
Guest dumbo

if you import an image sequence into after effects that is missing some frames, don't they frames show up as missing media in the comp window?

 

so if you scroll/play through the image sequence, its easy to spot the missing ones...

Share this post


Link to post
Share on other sites
Waaaaait a sec. Does this also answer the eternal question of 'how the hell do I know which frames in this image sequence are missing?' dilemma? Write the directory contents to a text file, import to Excel, make a column of numbers, see where they diverge. What I'm saying seems like overkill until you have a 2,500 frame render that's missing 13 frames and the missing frames are scattered all over that range.

You don't need a text file. I've been using this line of code for different processes that I use that require listing files for comparison.

I have never worked with Excel on a Mac so I have absolutely no idea how ViualBasic works on it (or even if it does).

Here's what I use (sort of):

Sub ListFiles()
'
' List Files by iso
'
'

FilePathDir = "C:\temp\"
Range("A1").Select

F = Dir(FilePathDir & "*.TGA")
 Do While Len(F) > 0
  ActiveCell.Formula = F
    ActiveCell.Offset(1, 0).Select
  F = Dir()
Loop


End Sub

In the example, all it does is Start creating a list of all TGAs starting at Cell A1 from directory C:\Temp\. I tend to use the filepath as a variable that reads from a cell so that the user doesn't need to worry about going into the code.

 

I haven't been very helpful lately. So if you guys give me a few specs, I'll gladly whip up an Excel file for you to do compares on a list of expected files (if it's helpful to anyone).

 

Cheers,

iso

Share this post


Link to post
Share on other sites

Well, during my breaks this morning, I made you guys a little file.

It may not be perfect, it doesn't handle project management. What it does do is find out which frames you're missing in a file sequence.

 

You can grab it here: http://www.isotrope.net/TheGoods/MissingSequenceFiles.zip

 

Basically, you fill in the path, the filename prefix, first frame number (keep the leading 0s), end frame number, extension,... hit the macro button and there you go.

A VBasic guru may laugh at the code, but it gets the job done.

 

If anyone has a minute or two and feels like testing it out, all you need to do is remove a few random frames from a folder and try it out (please don't delete them but move them ;) ).

 

Tested on a PC, no guarantees.

Share this post


Link to post
Share on other sites
You might want to try sdiff instead of diff to spit out just the difference.

With that many files, it may be a bitch to sift through.

 

sdiff -s file1.txt file2.txt

 

to output to a file do:

 

sdiff -s file1.txt file2.txt > diff.txt

 

im struggling with this a bit. i really just want to show the files that are different, but it keeps outputting full lists, which i would have to manually figure out the difference. i did a test yesterday where the result listed the contents of each txt file in side-by-side columns. but that isn't really working now. anybody have any ideas? im on a tight deadline and need to figure out what hasn't been done yet, out of 7500 that need to be completed. thanks in advance.

Share this post


Link to post
Share on other sites

sdiff -s filesToBeDone.txt filesDone.txt

or

diff filesToBeDone.txt filesDone.txt

 

should work. The only difference in sdiff is that it lets you merge two files interactively from

the command line. Are you including the -s flag on sdiff?

Edited by ESC

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...