Add timestamp of photos created by the “predictive capture” feature of Sony's Xperia camera app at the beginning of the filename

(setopt CSH_NULL_GLOB; cd /path/to/Camera\ Uploads; for i in DSCPDC_000*; do mv -v $i "$(echo $i | perl -lpe 's/(DSCPDC_[0-9]{4}_BURST)([0-9]{4})([0-9]{2})([0-9]{2})/$2-$3-$4 $1$2$3$4/')"; done)
The “predictive capture” feature of Sony's Xperia camera app hides the date stamp deeply inside the filename. This command adds another date stamp at the beginning of the filename.
Sample Output
'DSCPDC_0000_BURST20191215123205830.JPG' -> '2019-12-15 DSCPDC_0000_BURST20191215123205830.JPG'
'DSCPDC_0000_BURST20200119191047162.JPG' -> '2020-01-19 DSCPDC_0000_BURST20200119191047162.JPG'

0
By: langec
2020-04-12 06:20:59

What Others Think

I am a software engineer and I often go with such coding in my daily routine. But at times I get confused and I am not able to get through simple problems that require little attention and then I read reviews about edubirdie from youressayreviews.com source to get solution of my problems. Well, all thanks to you for guiding us with such ease. Well the coding is done accurately.
KurtisPowlowski · 7 weeks and 3 days ago
I am not sure if it works. I have been working on different APIs lately and found a few APIs that work with different devices. Haven't tried sitemap codes on the Xperia camera. Possibly because I do not use camera features much. I am a part of digital marketing services in US thus I can only work on the sitemaps that are related to apps and websites.
Timothyshaw · 4 weeks and 2 days ago
Implement directives issued by the state. Everyone joins hands to fight against epidemics, limiting moving out indoors to keep the living environment clean. fireboy and watergirl
pikachu88 · 3 weeks and 3 days ago
Thanks for the post. There are lots of good apps on the aptoide store. Everyone can access at https://apkrapido.com/aptoide/
delamada · 3 weeks and 1 day ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: