exiftool: how to get mp3 tag value without key? - exiftool

I can read my mp3's Title metadata with:
$ exiftool -Title 1.mp3
Title : Foo
But how to get Foo only ?

$ exiftool -s -s -s -Title 1.mp3
Foo

Related

Exiftool shortens string output

I am trying to get a string output using Exiftool. The original value should be:
1.00000095367432 -0.00040300001273863 -0.000503999995999038 0.000391999987186864 0.9999960064888 0.00425100000575185 -0.00258799991570413 -0.00425100000575185 0.999997973442078
But when I run the command:
exiftool -a -u -TAG image.jpg
Exiftool shortens the output. It returns:
1.00000095367432 -0.00040300001273863 -0.00050399999599[...]
How can I get the entire string value?
To get the full output, try disabling printConv. You can do this for all tags with the -n option but if you are extracting other tags at the same time, you can use the per tag option by adding # to the end of the tag name e.g exiftool -u -a -Manufacturer0x7121# .

In P4 command line I only need to get the Description and Files fields

Using CMD why this does not work ?
p4 --field Description="New CL description here" change -o changelist_number | p4 change -i
P4 change -o gives me the list of files and an empty description field. What is the best cmd batch command to change the description ? Considering I don't want to replace < enter the description here > with a string finder.
To change the description of a pending changelist, do:
p4 --field "Description=NEW DESCRIPTION" change -o CHANGE | p4 change -i
Note that you need an up to date p4 client executable (for the --field flag) and that this won't work on a submitted changelist since they're protected from editing.
This approach works for single line description but not multi-line description. Suppose I have a variable $desc that contains multiple lines, how will I use it with above command, since this is not working:
p4 --field "Description=$desc" change -o CHANGE | p4 change -i

Setting file modification date from exif date

To set the file modification date of images to the exif date, I tried the following:
exiftool '-FileModifyDate<DateTimeOriginal' image.jpg
But this gives me an error about SetFileTime.
So maybe exiftool cannot do it in linux.
Can I combine
exiftool -m -p '$FileName - $DateTimeOriginal' -if '$DateTimeOriginal' -DateTimeOriginal -s -S -ext jpg . with "touch --date ..."?
See this Exiftool Forum post.
The command used there is (take note of the use of backticks, not single quotes):
touch -t `exiftool -s -s -s -d "%Y%m%d%H%M.%S" -DateTimeOriginal TEST.JPG` TEST.JPG
But I'm curious about your error. Exiftool should be able to set the FileModifyDate on Linux (though FileCreateDate is a different story). What version of Exiftool are you using (exiftool -ver to check)?
Another possibility is that the DateTimeOriginal tag is malformed or doesn't have the full date/time info in it.
FWIW, StarGeek's answer was a great pointer in the right direction, but it did not work for me: many of my photos were reported to have "Invalid EXIF text encoding" (no obvious difference compared to those that were "fine"), even though exiftool somefile.jpg would clearly output a valid "Modify Date".
So this is what I did:
for i in *.jpg ; do d=`exiftool $i | grep Modify | sed 's/.*: //g'` ; echo "$i : $d" ; done
...to produce output like this:
CAM00786.jpg : 2013:11:19 18:47:27
CAM00787.jpg : 2013:11:25 08:46:08
CAM00788.jpg : 2013:11:25 08:46:19
...
It was enough for me to output the timestamps next to the file names, but given a little bit of date-time formatting, it could easily be used to "touch" the files to modify their filesystem timestamps.

Grep/Find/Xargs: Search between two strings in folder or result of Wget

I have a folder full of html files, some of which have the following line:
var topicName = "website/something/something_else/1234/12345678_.*, website/something/something_else/1234/12345678_.*//";
I need to get all instances of the text between inverted commas into a text file. I've been trying to combine FIND.exe and XARGS.exe to do this, but have not been successful.
I've been looking at things like the following, but don't know where to start to combine all three to get the output I want.
grep -rI "var topicName = " *
Ideally, I want to combine this with a call to wget also. So in order (a) do a recurisive mirror of a website (maybe limiting the results to Html files) i.e:
wget -mr -k robots=off --user-agent="Mozilla/5.0 (Windows NT 5.1) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11" --level=1 http://www.website.com/someUrl
(b) go through the html in each result and check if it contains the text 'var topicName', (c) if so, get the text between 'var topicName =' and '"' and write all the values to a text file at the end.
I'd appreciate any help at all with this.
Thanks.
For grabbing the text from the HTML into a file:
If your version of grep supports it, the -o switch tells it to only print the matched portion of the line.
With this in mind, 2 grep invocations should sort you out (provided you can identify uniquely ONLY the lines you wish to grab the text for); something like this:
grep -Rn "var topicName =" html/ | grep -o '"[^"]*"' > topicNames.dat
If it's unacceptable to leave the " symbols in there, you could pass it via sed after the second grep:
grep -Rn "var topicName =" html/ | grep -o '"[^"]*"' | sed 's/"//g' > topicNames.dat

Regex with wget?

I'm using wget to download some useful website:
wget -k -m -r -q -t 1 http://www.web.com/
but I want replace some bad words with my own choice (like Yahoo pipes regex)
If you want to regexp out words from within the page you are fetching with wget, you should pipe the output through sed.
For example:
wget -k -m -r -q -t 1 -O - http://www.web.com/ | sed 's/cat/dog/g' > output.html
Use the -O - flag to write the output to stdout, and the -q flag to make wget run in quiet mode.
Haven't got a shell atm to check my syntax but that should set you on the right path!
You can use sed -i.
find www.web.com -type f -exec sed -i 's/word1\|word2\|word3//ig' {} +
word1, word2, word3, etc. are the words to delete.