coffee singles

god and singles

adults personals

online gay chat rooms

www suceuses com

asians girls

freind finder

single asian

craigs list women seeking men

amputee dating sites

internet hookups

fine date

yahoo personals australia

cheating wives movies

mankato singles

mail ordered bride

dating in bc

nauty wifes

single women in prison

volunteer singles

local swinger ca

sex escots

swinging wife

swinger heaven

russian women dating

freegirls

friend finder ca

singles alternative

singles 100 free

fling dating site

free dating service uk

married couples swinging

singles cheltenham

big round black booty

chat new jersey

sex

baltimore singles events

sheboygan singles

find sex buddy

match lit

fre sex chat

davenport iowa singles

video dating online

russian brides online

swinging in maine

hindu dating

phone dating services

sex dating websites

one night stand matches

singles active

dating agency north west

girlfriends films women seeking women

1 dating match

datingclub

asian chat cam

sex date uk

dating in oxfordshire

british columbia singles

dr phil dating

sm dating

dating fish plenty

singles cheshire

men and dating

gospel singles

ridgecrest singles

sex phone chat lines

millionair dating

pueblo singles

singles 3

dating sites new

pa personals

las vegas personal trainers

date agencies

chaude com

bi sexual female

online dating in new york

callgirls com

sex flirt

www olderladies com

christians singles

local girls sex

swinger cruise

single roses for sale

sex dates

singles resorts

personals co

black female sex

online free dating site in usa

dating san diego

soft swing stories

finding single men

jamaica swinger

dating danish

escort man

alternative personals

wemon looking for sex

www adolt

lesbian finder

ireland personals

houston asian escort

How Do I: Fix Downloaded Pictures from a Motorola Razr

Posted by jonathan on September 28, 2006

One minor problem with my Motorola Razr is that the filenames of downloaded images are munged into a somewhat stupid ‘DD-MM-YYY_xxxx.jpg’ format. And as dates are not preserved when I load the files across into my Mac, I wind up with a bunch of stupidly named and largely unsortable files.

Ok, this is a job for a command on UNIX (Mac OS X in this case) called AWK. AWK is one of the most venerable of the UNIX command-line utilities. Wikipedia has a page on AWK here.

The easiest way to describe AWK is that it allows you to apply a condition to a line of input, and to then ‘do something’ with lines of input that meet the condition, typically printing a new format, or building a command and piping to some other program.

The following piece of AWK applies all three of these common behaviors to do the following:

  • Pick up a filename
  • Ignore the filename if it does not start with two digits
  • Reformat the filename into a simple ‘mv’ command
  • Pipe the ‘mv’ command to a cshell


$ ls | awk 'substr($0,1,2)+0 > 0{print"mv "$0" 20"substr($0,7,2)"-"substr($0,4,2)"-"substr($0,1,2)"_"substr($0,10,4)".jpg"}' | csh

In this case, we transform ‘dd-mm-yy_xxxx.jpg’ to ‘mv dd-mm-yy_xxxx.jpg yyyy-mm-dd_xxxx.jpg’ and execute the commands in a csh.

The funny looking part at the start is the condition, which simply tests that substr($0,1,2) added to 0 is a number > 0.

Have fun with AWK.

Trackbacks

Use this link to trackback from your own site.

Comments

Leave a response

Comments