Column headers for output

Started by Birdman, February 05, 2021, 11:18:19 AM

Previous topic - Next topic

Birdman

Hello,

I am trying to generate a csv-output using the -p in order to use a different delimiter for my Excel-version. This works fine, except that there are no hesders for the columns:
exiftool -p "$artist; $description; $keywords; $subject; $copyright; $make; $model" *.jpg > Bilduebersicht.csv

How must this be written?
Best regards,

Martin (Birdman)

StarGeek

See the -p (-printFormat) option docs.
   Lines beginning with #[HEAD] and #[TAIL] are output before the first processed file and after the last processed file respectively.

It might be easier to put it all in a .fmt file.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Birdman

Thanks,

but that's not quite what I meant. I need the header of each csv-column. Generally the easiest way would be to generate the output file with the -csv-command. There I have all the column headers for each column. But with the csv the delimiter is "," and I need ";".

What I am looking for the output is like this:
Title1; Tag2; Tag3; Tag4
File1; F1Tag2; F1Tag3; F1Tag4
File2; F2Tag2; F2Tag3; F2Tag4
Best regards,

Martin (Birdman)

Birdman

Just found it. This will work:
exiftool -echo "Dateiname; Autor; Beschreibung; Ueberschrift; Stichwoerter; Marke; Modell" -p "$Filename; $artist; $description; $headline; $keywords; $make; $model" *.jpg > Bilduebersicht.csv

Thanks again!
Best regards,

Martin (Birdman)

StarGeek

Quote from: Birdman on February 05, 2021, 12:07:57 PM
but that's not quite what I meant. I need the header of each csv-column.

I'm not sure how it's not what you meant.  The #[HEAD] line is printed once at the beginning of the output to make a header.  Short example
C:\>exiftool -g1 -a -s -ext jpg -p "#[HEAD]Filename; FileModifyDate" -p "$Filename; $FileModifyDate " y:\!temp\Test*
Filename; FileModifyDate
20140404_040405.jpg; 2017:05:30 15:11:37-07:00
Test1.jpg; 2019:10:11 15:30:28-07:00
20180629094941_1_2.jpg; 2018:06:29 09:49:41-07:00
20180629094941_1_Crop_1.jpg; 2018:07:23 18:07:31-07:00
20180629094941_1_Exact_crop.jpg; 2018:07:23 14:50:46-07:00
20180629094941_1_Lossless_crop.jpg; 2018:06:29 09:49:41-07:00
20180629094941_1_Tranoutput.jpg; 2018:07:23 16:41:56-07:00
20180629094941_1.jpg; 2018:06:29 09:49:41-07:00
20180629094941_1_CropCrop.jpg; 2018:07:23 15:54:28-07:00
20180629094941_1_Crop_2.jpg; 2018:07:23 18:18:51-07:00
20180629094941_1_Crop_3.jpg; 2018:07:23 18:18:59-07:00
20180629094941_1_Crop_4.jpg; 2018:07:23 18:19:01-07:00
Test2.jpg; 2020:05:09 12:25:41-07:00
Test3.jpg; 2020:07:07 08:35:22-07:00
Test3a.jpg; 2067:12:31 23:59:59-08:00
Test4-edited.jpg; 1971:01:01 00:00:00-08:00
Test4-temp-25925.jpg; 2019:10:11 15:30:29-07:00
Test4.jpg; 2021:01:26 08:22:03-08:00
Test44.jpg; 1971:01:01 00:00:00-08:00
Test5.jpg; 2019:06:10 09:57:49-07:00
Test7.jpg; 2019:10:11 15:30:28-07:00
TestGrayscale.jpg; 2017:03:06 10:36:50-08:00
TestTiff.jpg; 2017:09:11 18:30:01-07:00
test_1.jpg; 2018:12:13 12:18:54-08:00
test_drive.jpg; 2019:10:11 15:30:28-07:00
Test_small.jpg; 2018:07:17 11:34:14-07:00
Test_Tiff.jpg; 2017:09:11 18:30:01-07:00
    3 directories scanned
   27 image files read
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Birdman

Still one last "problem" about the csv-output. The code works fine and produces coloumn titles as intended. But one tag has german "Umlaute" which are not encoded right in the output column ($copyright). I have read several exiftool explanations about the charset function now but still have no clue, how and especially where I just specify a different charset. I tried different hints from the forum but none worked so far. Either nothing changes or the whole output process will not work.

exiftool -echo "Dateiname; Autor; Beschreibung; Ueberschrift; Copyright; Modell" -p "$Filename; $artist; $description; $headline; $copyright; $model" *.jpg > Bilduebersicht.csv
Best regards,

Martin (Birdman)

StarGeek

* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Birdman

I tried -L, but no effect whatsoever.
Best regards,

Martin (Birdman)

StarGeek

Are you one Windows 10?  You might try this StackOverflow answer.  Otherwise try FAQ #18.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Birdman

Best regards,

Martin (Birdman)

Birdman

Had to switch back the StackOverflow-thing. Exiftool and its outputs worked real fine, but a day later I had to experience, that almost all other software (especially the MS ones) now had problems with Umlaut-characters. No problem, something I can live with.
Best regards,

Martin (Birdman)