OCRソフトを通して実際に得られる文字列を 2004/04/25 16 31 2009_01_19_22_34_10.wmv ��日付、分、秒、元のファイル名) というように想定し、この文字列を元に日付を取得し、変換するスクリプトに修正しました。 結局splitコマンドは使わずにIndexから文字列を抽出。 ��参考URL http://ameblo.jp/archive-redo-blog/entry-10034128031.html) また余計な文字列の削除にはreplaceAllを使用しました。 次回はファイルのリストを読み込んで一括処理するようにします。 それともう少し条件分岐のところを綺麗にするか。。。 /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package filerename; import java.io.File; import java.util.Calendar; /** * * @author nao */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here //setup initial variable String folderpath = new String("C:\\Documents and Settings\\nao\\デスクトップ\\"); String inputString = new String("2004/04/251631 2009_01_19_22_34_10.wmv"); //Modify inputString String afterReplace1 = inputString.replaceAll("/", ""); String afterReplace = afterReplace1.replaceAll(" ",