Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Mar 2009 15:57:51 -0400
From:      David Banning <david+dated+1238356671.fa5de5@skytracker.ca>
To:        questions@freebsd.org
Subject:   renaming many Chinese files
Message-ID:  <20090324195751.GA20259@skytracker.ca>

Next in thread | Raw E-Mail | Index | Archive | Help
I have hundreds of jpg images where each image is named P123****.jpg
where the **** are chinese characters. I can't open the file - it
has to be renamed before I can open it. Evening if I could open it
I don't want the Chinese part as the name.

Each file starts with 3 or four western characters and then has 3 or
four chinese characters, before the western .jpg extension.

I want to to test each filename character by character
to see if it is western, and then when the first Chinese Character is 
found, have it simply rename the file to the 3 or four western-character 
name + .jpg

I can write most of the script but I don't know how to test for 
western and/or Chinese characters.
 
I could run a script that would simply rename all the files to 
a number in sequential order but I would rather use the existing
starting name of the file if possible.




Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?20090324195751.GA20259>