Write keywords to files using a table of filenames and keywords - import-from-excel

I conduct research on rainforest cats in Africa. I have been using exiftool to extract keywords from photos to create tables that I can analyse. More camera trap studies are starting to use this method, so I suspect this question may eventually be relevant to quite a few people, especially when thousands of files are routinely backed up off-site prior to keywording.
I have had some students in South Africa keyword one of my camera trap surveys. These students have made errors in the past, so I need to double check their work before analysing. I have all of the photos (which I gave them) with the same filenames. I would like to know if it is possible for them to extract the keywords to a .txt file (using -filename and -keyword operators) in South Africa, email that file to me and THEN for me to write those keywords to the same files on my hard drive. This would be considerably easier than transferring 60 Gb of photographs.
I am using MacOSX 10, so perhaps this is more of an Automator problem, but many camera trap users have PCs, so it would be better to use exiftool if possible.

David, you can export to a csv file using exiftool, something like:
exiftool -xmp:all -csv . > ThisSet.csv
Make your corrections to that csv file in a spreadsheet, then import to your images.
exiftool -overwrite_original_in_place -L -csv=\Users\TIPUTINI\DarwinCore\ThisSet.csv \Users\TIPUTINI\DarwinCore\Photos\
I was doing something similiar at a research station in the Ecuadorian Amazon.
Note that exiftool supports embedding Darwin Core into the captured images. I think that would be very useful for camera trap images, don't you?

Related

Is there a way to convert/export tracking files (.trc files) from media cybernetics Image Pro Plus to a .mat file type?

I am a biology graduate student trying to export these files so that they can be used with a matlab based automated behavior classification software JAABA. It looks like there is no direct way to save .trc files as .mat (http://www.mediacy.com/imageproplus/specifications). At the very least I would like to figure out a way to read the format of the .trc files so that I could write a script to get them to make sense for JAABA. If anyone is familiar with either of these programs or both, or could simply point to a good way to write an importer (definitely outside of my skill set) I would be very grateful.

Grouping two files into one custom file-type

I am currently working on a simple tower defense game for iOS (using objective-c), which contains several maps/levels. However, as it is now, each map consists of an image file and a .plist file with information. My question is: is there any way I could create a custom file type (for example, *.map) that contains both the image and the information from the plist?
If this is possible, how do I implement this?
Thanks in advance!
You have several good choices for that:
The simplest solution would be grouping the related files in subfolders: rather than having xyz.map file, you could have an xyz sub-folder, and reference the files out of it. You would not need to use any additional libraries for this, and you would be able to use the same name for all your image files and all your level files, because they would be in separate folders.
You can make a zip archive with the files that you would like to combine, and unzip it before use. Here is a link to an answer referencing a library to do it.
You can use a tar format - here is a list to an answer referencing a library that supports it. You would be able to use tar utility on OS-X to group images with plists on your workstation.
Finally, you can define a format of your own: store the length of the first file in the first four bytes, then store the content of the first file, and then the second. You would need to write a utility for combining the two files into one. This sounds like the hardest choice to implement.

how to annotate files - when long filenames are not enough

I work with many files doing general data analysis.
Things I want to know about my files include:
what data is contained in the file (in long and very long descriptive, english text)?
is the file downloaded from somewhere (where? when?) or generated by a program (which one?)
why I made this file, verbal description what I want to do with it, where it belongs in my data analysis workflow (additional english text description, can get very long as well)
For this, long filenames are simply not the solution! Even long filenames are too short for the full descriptions, and when actually working with the files (perl, awk, R) the long filenames get in the way.
What I do right now is make a readme in each dir with the filename, tab-separator, and the long description. However this solution is very cumbersome as you can imagine because the descriptions are completely separated from the filesystem and everything, the readme has to be maintained and updated separatedly etc.
Is there any tool one can use for really verbose, systematic descriptions of filenames? Maybe even integrated into the filesystem?
Operating system used: Windows 7 and Cygwin, various flavours of linux/unix through SSH and importing X

Command line CSV viewer with column-alignment for LARGE files

I would like to view my CSV files in a column-aligned format from the command line, with something like less, but my CSV files are sometimes gigabytes big, and I'm using a little computer (Netbook, 1GB RAM, 8GB HD, 1GHz processor), so I don't want to waste a lot of memory or processing power viewing the file.
I mention that I'd like to use something like less because I would like to be able to navigate around within the file.
cat FILE | column -s, -t | less is one thought, but cat is still going to try to print the whole file and I'm not sure how much buffering the pipes will use (if any) or what sort of caching less employs.
This question is similar to this other question, but I'm specifically interested in viewing large files using minimal resources preferably already on the machine. I don't presently use VI or EMACS, and think they'd both be overkill here. VI, for instance, would be a 27MB install for a utility acting merely as a viewer.
First of all, less can open oversized files. Second, both vim (which I use with the Largefile plugin and with files over 8 GB) and emacs can do it.
But... Most of the time, viewing a big file in a 80x40 (or a bit bigger) terminal is useless... so you should filter it with something like (f)grep or process it with awk. If you want only the start or end, then there are head and tail.
HTH
Check the tail \ head commands.
Or even better, Download VIM source and compile it. That should be easy enough. Version 5.8 source is 1Mb before decompressing (4MB after). Enjoy.

Create Numbers file and open it with Numbers on iPad

I would like to do a task that is quite simple on other OS, but it is not so trivial on iOS. Namely, I want to create file and open it in Numbers.
I can preview the file with UIDocumentInteractionController and then offer it to user that he/she opens it.
THis seems to me quite a reasonable solution. However, I need to offer proper file format. I suppose CSV and XLS would be reasonable to implement and it would most probably work, but I would still like to do it in native Numbers format if possible. However, I can't find any info about this file format.
Basically, this task is about exporting data to another app and then working further with them.
I don't know of a library that can create native Numbers files. There are hoewever some libraries that allow creating XLS files. Since Numbers fully supports XLS, this is probably the way to go.
There is a comercial library available that might work on the iPhone (costs $200): http://www.libxl.com/
As for free XLS libraries, I only know xlwt, a Python module. You could set up a webservice that creates an XLS file for your app, using xlwt on the server side.
If you want to pass information to Numbers, you can probably also use CSV files. If you use CSV files, you must be aware of some things. There are two kinds of CSV files: the comma separated version (used in english speaking countries) and the semicolon separated (used in continental europe).
The comma separated CSV files look for example like this:
"ID","First Name","Last Name","Salary"
1,"John","Malkovich",3400.20
2,"Fred","Astaire",2000.60
The second kind of CSV files are semicolon separated and use a comma as decimal mark. They look like this:
"ID";"First Name";"Last Name";"Salary"
1;"John";"Malkovich";3400,20
2;"Fred";"Astaire";2000,60
On the Macintosh, Numbers expects a different format depending on the Region setting. If you have your Region set to the US, it will expect the first kind. If you choose Germany, it will expect the second kind.
I don't know what kind of files Numbers on the iPad expects.
Another alternative would be using copy and paste. Try to copy tab separated text into the clipboard.
I hope this may help you. I've contacted libxl team and they responded with the link to the demo version of their iPhone library: http://www.libxl.com/download/libxl-iphone.zip