我是做船舶制造的,以前在学校学过DELPHI 
我要的做的目的是将 excel表中的某行中一样的字段导入记事本中。
比如
Circ.   Length Circ   Width

0.126 848.5 413.7 16
0.126 848.5 413.7 16
0.043 493.3 100 14
0.043 493.3 100 14
0.21 1131.4 544.5 16
0.21 1131.4 544.5 16
0.061 670.9 100 14
0.061 670.9 100 14
0.735 1630 800 13
width字段中16导出导记事本中,13的导出导另一个记事本中,14的导出到另一个记事本中。
如何能做到。
谢谢 源码

解决方案 »

  1.   

    procedure TForm1.Button1Click(Sender: TObject);
    begin
     if OpenDialog1.Execute then
     begin
       filename:=OpenDialog1.FileName ;
       edit1.Text:=filename;
     end;end;procedure TForm1.Button2Click(Sender: TObject);
    Var
          FList:   TStringList;
          name:String;
          myexcel:variant;
          neirong:string;
          i:integer;
     Begin myexcel:=createOLEobject('excel.application');
     myexcel.visible:=false;
     myexcel.Workbooks.Open(filename);
      if savedialog1.Execute then
      begin
         for i:=1 to 200 do
     begin
    neirong:=myexcel.Cells[8,i].value;
    name:=savedialog1.FileName;
    FList:=   TStringList.Create;
    FList.add(neirong);
      end;
          FList.savetofile(name);
          FList.free;
      end;
     end;
    我自己试着写了下,但是循环好像不好使。