代码是这样的,从NuCoef.data文件中读数赋给整形数组Nals:77行、5列,接着读数赋给浮点数组Cls:77行、6列,您要是愿意帮忙的话,麻烦您给我个邮箱,我把NuCoef.data文件发给您,您把读出来的数存成TXT格式的文件再发给我,谢谢了!
program Project1
const NutNum = 77;Nals:array[1..NutNum, 1..5]of interger;
Cls:array[1..NutNum, 1..6]of extended;constructor TCoorTrans.lni;
begin
FStream:=TFileStream.Create('NuCoef.data', fmOpenRead);
FStream:Read(Nals,Sizeof(Nals));
FStream:Read(Cls, Sizeof(Cls));
FStream.Free;
end

解决方案 »

  1.   

    还有几行代码,
    FileNme:string
    FStream:TFileStream;
      

  2.   

    源文件NuCoef.data我已经传到CSDN的下载资源里面了,愿意帮忙的好心人可以从上面直接下载,下载方法是进入我的空间,在资源选项中选择更多那个选项,就可以看到我的上传资源,源文件就在那;或者直接去下载频道搜索NuCoef.data,谢谢啦
      

  3.   

    你是真不会还是假不会呀,你都已经知道怎么读出来了,还不会输出文本文件吗.
    const
      NutNum=77;
    var
      Nals:array[1..NutNum, 1..5] of integer;
      Cls:array[1..NutNum, 1..6] of extended;procedure TForm1.Button2Click(Sender: TObject);
    var
      fs:TFileStream;
      i,j:Integer;
      s:string;
    begin
      fs:=TFileStream.Create('c:\NuCoef.data',fmOpenRead);
      try
        fs.Read(Nals,Sizeof(Nals));
        fs.Read(Cls, Sizeof(Cls));    Memo1.Clear;
        for i:=1 to NutNum do
        begin
          s:='';
          for j:=1 to 5 do
            s:=s+' '+IntToStr(Nals[i,j]);      Memo1.Lines.Add(s);
        end;    for i:=1 to NutNum do
        begin
          s:='';
          for j:=1 to 6 do
            s:=s+' '+FloatToStr(Cls[i,j]);      Memo1.Lines.Add(s);
        end;
      finally
        fs.Free;
      end;
    end;