有什麼快的辦法在一批文件的文件名的第二位加一個0

解决方案 »

  1.   

    www.baidu.com搜索"批量修改文件名"
      

  2.   

    Total Commande 里面有个批量重命名文件功能,[N#-#]的重命名方法符合你的要求
      

  3.   

    to xxmmmx(踢踏) ( ) 信誉:105 total commande是什麼?
      

  4.   

    给你写了一个,WINXP+D7下测试通过
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        Button1: TButton;
        Memo1: TMemo;
        Button2: TButton;
        Edit1: TEdit;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure renames(APath, Sourfile: string);
    var
      FSearchRec : TSearchRec;
      FindResult : integer;  s : WideString;
        function IsDirNot(A : string) : boolean;
      begin
        Result := (a = '.') or (a = '..');
      end;
    begin  try
       FindResult := FindFirst(Apath+Sourfile,faDirectory,FSearchRec);
       while FindResult = 0 do
       begin
          if ((FSearchRec.Attr and fadirectory) = faDirectory) then
          begin
            if  not IsDirNot(FSearchRec.Name) then begin
            s := FSearchRec.Name;
            Insert('0',s, 2); //在第二位插入0        RenameFile(apath+FSearchRec.Name,apath+s);
            renames(APath + FSearchRec.Name + '\',Sourfile);
            end;
          end else begin
            s := FSearchRec.Name;
            Insert('0',s, 2);
            RenameFile(apath+FSearchRec.Name,apath+s);
          end;
          FindResult := FindNext(FSearchRec);
       end;
      finally
       FindClose(FSearchRec);
      end;
    end;procedure TForm1.Button1Click(Sender: TObject);
    begin
      renames('d:\sql\','*.*');
    end;end.
      

  5.   

    Total Commander 功能强大的全能文件管理器(简称TC)。http://www.vipcn.com/SoftView/SoftView_7378.html
      

  6.   

    我上面给你的代码,你在DELPHI中编译一下,可以根据指定的后缀名以及指定文件夹进行修改,修改的规则就是在文件名的第二为加一个0
      

  7.   

    to xxmmmx(踢踏) ( ) 信誉:105 
    用那個裡面的哪個工具呀。
      

  8.   

    在“常用-批量重命名文件”里面,或者按Ctrl+M
      

  9.   

    to wudi_1982(︻┳═一酒可千日不饮,但不可一饮不醉) ( ) 信誉:96  2006-08-16 16:18:00  得分: 0 
    你給我的代碼可以實現收集指定文件夾下面的所有指定後綴的文件集不。
      

  10.   

    下面的收集指定文家夹下指定后缀名的文件集的,其实和上面的没多打区别,都是使用FindFirst以及findnext配合递归实现文件查找,不同在于查到到文件后的处理方式,上面是将文件名改了,下面是将文件明输出到列表。。合成一下,就可以二者都实现。
    procedure TForm1.Findds(AStrings: TStrings; APath, Sourfile: string);
    var
      FSearchRec : TSearchRec;
      FindResult : integer;
      TmpList:TStringList;
      i : integer;
        function IsDirNot(A : string) : boolean;
      begin
        Result := (a = '.') or (a = '..');
      end;
    begin
      try
       TmpList:=TStringList.Create;
       TmpList.Clear;
       FindResult := FindFirst(Apath+Sourfile,faDirectory,FSearchRec);
       while FindResult = 0 do
       begin
          if ((FSearchRec.Attr and fadirectory) = faDirectory) then
          begin  
            if  not IsDirNot(FSearchRec.Name) then begin
            tmplist.Add(apath+FSearchRec.Name);        Findds(AStrings, APath + FSearchRec.Name + '\',Sourfile);
            end;
          end else tmplist.Add(apath+FSearchRec.Name);
          FindResult := FindNext(FSearchRec);
       end;
          for i := 0 to TmpList.Count -1 do
         AStrings.Add(TmpList.Strings[i]);
       TmpList.Free;
      finally
       FindClose(FSearchRec);
      end;
    end;
      

  11.   

    postfxj(探索者)  vs  wudi_1982(︻┳═一酒可千日不饮,但不可一饮不醉)1

    3
      

  12.   

    最快的方法,什么工具都不用,用批处理写一个,如1.bat,要改的目录在e:\temp\temp
    @echo off
    cd e:\temp\temp
    for %%i in (*.*) do (
    set LIST= %%i
    set KKK=!LIST!
    set m=!KKK:~1,1!0!KKK:~2!
    ren !KKK! !m!
    )
    然后,进入命令行,执行:
    cmd /v:on /c 1.bat
    就可以了
    ------------------------------------------------------------------
    win2k/xp的cmd拥有强大的功能,虽然不能与unix的shell相比,但要完成一般的文件/文本处理,足够了