News:

2023-08-10 - ExifTool version 12.65 released

Main Menu

What are these called?

Started by terrypin, March 19, 2013, 10:38:13 AM

Previous topic - Next topic

Phil Harvey

Terry,

I'm confused about why you said it didn't work.

When you ran the command, the current working directory was "C:\Documents and Settings\Terry", so this is where "out.txt" will be written (since you didn't specify a directory for out.txt).

Since you specified a directory for the images ("C:\images"), the current working directory doesn't come into play for locating the images.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

terrypin

Hi Tarn,

Excellent help, thanks a bunch! Really appreciate your taking the time.

I'll try your suggestions later today, with an easily run batch program to produce that text file as my practical objective. And some solid learning as I go!

I wonder if you saw the earlier discussion I had with Phil in the thread https://exiftool.org/forum/index.php/topic,4881.0.html
about one flaw with the output, namely its reversal of the path separators?

IOW, from the correct
C:\Docs\My Pictures\PHOTOS\Walks UK\TP04\TP04-All\Tests\20040817-103458.JPG
to the incorrect
C:/Docs/My Pictures/PHOTOS/Walks UK/TP04/TP04-All/Tests/20040817-103458.JPG

It's easily fixed in my text editor with a global change, of course, but do you know if there's a way to do it within the ExifTool commands?

--
Terry, East Grinstead, UK

terrypin

Quote from: Phil Harvey on March 20, 2013, 07:59:06 AM
Terry,

I'm confused about why you said it didn't work.

When you ran the command, the current working directory was "C:\Documents and Settings\Terry", so this is where "out.txt" will be written (since you didn't specify a directory for out.txt).

Since you specified a directory for the images ("C:\images"), the current working directory doesn't come into play for locating the images.

Hi Phil,

Did you miss my Edit?

You underestimated my rustiness with the use of DOS commands! Largely why I installed the GUI, remember?  :)

But as you see from that Edit, the penny dropped a few minutes later and then your command worked fine.

I also had a variation from Tarn which I'm about to try.

One thing (of several!) that's confusing me a bit. Is this 'redirect' method using the '>' equivalent to using '-w txt' as in the command discussed in an earlier post of of mine:
"....drag a file containing EXIF data onto the executable exiftool(-a -u -g1 -w txt).exe  and "...a TXT file will be silently written in the original folder, containing all EXIF/Comment data"?

As per my post to Tarn a few minutes ago, my focus now is on getting a batch file that will produce this text file (preferably with correct backslash path seperators).

Must say I was very impressed with the speed. It was only a small folder of 11 files, but my macro approach takes several seconds, with a lot of annoying screen activity.

--
Terry, East Grinstead, UK

Phil Harvey

Hi Terry,

Yes, I read your edit, but I was still confused.  If you aren't confused then that's all that matters.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

terrypin

Quote from: Phil Harvey on March 20, 2013, 11:48:30 AM
If you aren't confused then that's all that matters.

Well, not sure about that! For example, any advice on my question about -w?

--
Terry, East Grinstead, UK

Phil Harvey

Quote from: terrypin on March 20, 2013, 11:51:16 AM
Well, not sure about that! For example, any advice on my question about -w?

">" writes to a single output file for the entire command.

-w writes to a different output file for each input file.

-W (capital) writes to a different output file for each tag.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Tarn

Hi Terry,

Quote from: terrypin on March 20, 2013, 10:52:39 AM
Hi Tarn,

Excellent help, thanks a bunch! Really appreciate your taking the time.

I'll try your suggestions later today, with an easily run batch program to produce that text file as my practical objective. And some solid learning as I go!

I wonder if you saw the earlier discussion I had with Phil in the thread https://exiftool.org/forum/index.php/topic,4881.0.html
about one flaw with the output, namely its reversal of the path separators?

IOW, from the correct
C:\Docs\My Pictures\PHOTOS\Walks UK\TP04\TP04-All\Tests\20040817-103458.JPG
to the incorrect
C:/Docs/My Pictures/PHOTOS/Walks UK/TP04/TP04-All/Tests/20040817-103458.JPG

It's easily fixed in my text editor with a global change, of course, but do you know if there's a way to do it within the ExifTool commands?

Glad that my rambling helped. I did see, read, and learn from that topic. And, although I haven't attempted it yet, I would say that Phil's solution would be the best one. Definitely better than one I could offer.

As for changing the slash character in the output... I'm at a loss. I'm certain that there might be a way to (maybe) do it; unless I'm wrong. But that would be best asked of Phil. On a side note, may I ask why you want to change them in the first place? I'm going to guess that you are trying to generate output for a website(?).

Let me say something that might help you understand the redirect a little more. The redirect is nothing more than turning your screen off and your file on. Simply put the ">" sends anything that would have shown up on your screen, to the file you specify (out.txt in this case). Also, this happens outside of your command; meaning that it has nothing to do with the command itself; only the output of the command. There is nothing more to it. Screen=Off,out.txt=On. Once the command has finished, output returns to the screen.

The -w, and -W options act from within the command, as part of the command. While all three may produce similar output, it is how they produce that output that matters. At this point, I am not familiar enough with the -w and -W options to give you a good answer. All I know is that the -w, and -W options will generate output to a file as part of the command. > will send all output from the screen to a file.

Also, a little note about "DOS", or "The Command Line", or "running CMD"; You (probably) think that running CMD is running a program from within windows. (Here is where I'm going to catch some flack) It's not! Windows is nothing more than a fancy, very fancy, way of issuing DOS commands. And while Windows is called the operating system, it still boils down to the fact that Windows provides an easy way to issue DOS commands. Typing "dir" at the Dos prompt, and clicking on Windows explorer do the exact same thing; they list the files in a directory. Double clicking on the "images" folder in your explorer window does the exact same thing as typing "CD images" at the Dos prompt. That's all there is to it. So set any fears you may have aside and relax. In my humble opinion, DOS is still the most powerful way to manipulate files. More cumbersome due to the typing, but much more powerful.

All you need to do in order to survive at the Dos prompt is to get comfortable with, and understand three (non destructive) commands; "DIR", "CD" and HELP. That's it. ExifToolGUI and explorer can do the rest. Other Dos commands that are not necessary, but could make your life easier, are: "MD", "RD", "XCOPY", and "REN". Use caution with these as they will: Make a directory, Remove a directory, Copy files from one place to another, and Rename files. All have the potential of creating problems if they go awry.

The last, and most dangerous one is "DEL".
"DEL a.jpg"  is a file killer!         
"DEL *.*"     is a directory killer!         
"DEL *.* /s" is a drive killer!
"DEL" deletes files, and DOES NOT send them to the recycle bin. To recover a file that has been deleted from the Dos prompt, you'd better have some nice recovery software installed (which, I do). Don't fear it... respect it. While a very useful command, you need to think before you use it.

My whole point is that the command window, or Dos prompt, is nothing to be afraid of. People have written volumes about DOS commands; I could write a pamphlet and say the same thing. DOS is easy. Forget all the horror stories that you've heard about DOS. They are stories of a youngster who, having just gotten their driver license, gets into a formula race car, and stomps on the gas; meaning they tried to use the full power of DOS before they understood the full power of DOS.

In fact, what makes Exiftool.exe, the non GUI, version so powerful is because it does work at the command leve, at the Dos prompt. Because of this you don't go through a user interface; you don't have to worry about learning how to get the interface to do what you want. You learn a few, simple, commands and you operate on the the files directly. So cool!

Now the down side of that is that you don't have the GUI checking for common errors and stopping you before you make changes.

Hope this helps.

P.S. DOS is NOT "out to get you". (it's your computer that's out to get you).