我是做船舶制造的,以前在学校学过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的导出到另一个记事本中。
如何能做到。
谢谢 源码
我要的做的目的是将 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的导出到另一个记事本中。
如何能做到。
谢谢 源码
解决方案 »
- delphi调用word的问题!请各位这方面比较擅长的帮解释一下!
- Excel2000 不能在Excel2003环境导出数据!
- 一个很实在的问题?
- 在dbgrideh操作数据时,如何限定dbgrideh单元格输入字符的长度和类型?
- XMLDocument中,这样对一个节点进行修改、删除等操作呢?
- 在formula one 6.1中如何实现拷贝、粘贴
- 大侠救命!!!(有源码)
- 能将一个ADO记录集直接返回给一个数组吗?
- DBgrid组件中移动记录时产生什么事件
- DELPHI XE10 在模拟器上执行程序黑屏,详细现象及配置见图
- 怎样确定是什么程序或者进程调用了API呢!
- RMB请人修复代码BUG
2. 抓取最后两个字符是否匹对【13,14,16】
3. if str=‘13’ then 将该行写入文字档中,依次判断14,16的情况
'Data Source=study;Extended Properties="DSN=study;DBQ='+
path+'study;DefaultDir='+path+';DriverId=790;FIL=excel 8.0;'+
'MaxBufferSize=2048;PageTimeout=5;";Initial Catalog='+path+'study';
try
self.ADOConnection3.Connected:=True;
con:=True;
except
con:=False;
end;
if con=False then
Exit;
self.ADOQuery4.Close;
self.ADOQuery4.Connection:=self.ADOConnection3;
Self.ADOQuery4.SQL.Clear;
self.ADOQuery4.SQL.Add('select * from [sheet1$]');
self.ADOQuery4.Open;
self.ADOQuery4.First;
while not Self.ADOQuery4.Eof do
begin
s:=self.ADOQuery4.FieldByName('width).AsString;
if s='16' then
begin
end;
if s='13' then
beign
end;
if s='14' then
beign
end;
self.ADOQuery4.Next; end;
self.ADOConnection1.Connected:=True; self.ADOQuery1.Close;
self.ADOQuery1.Connection:=self.ADOConnection1;
Self.ADOQuery1.SQL.Clear;
self.ADOQuery1.SQL.Add('select * from [ws$]');
self.ADOQuery1.Open;
self.ADOQuery1.first;
while not Self.ADOQuery1.Eof do
begin
ws1:=adoquery1.fieldbyname('Thickness').AsString;
if ws1='16' then
ws:=ws+1;
end;
edit1.Text:=inttostr(ws);
end;
这样之后死机
self.ADOConnection1.Connected:=True; self.ADOQuery1.Close;
self.ADOQuery1.Connection:=self.ADOConnection1;
Self.ADOQuery1.SQL.Clear;
self.ADOQuery1.SQL.Add('select * from [ws$]');
self.ADOQuery1.Open;
self.ADOQuery1.first;
while not Self.ADOQuery1.Eof do
begin
ws1:=adoquery1.fieldbyname('Thickness').AsString;
if ws1='16' then
ws:=ws+1;
end;
edit1.Text:=inttostr(ws);
end;
这样之后死机
while not Self.ADOQuery1.Eof do
begin
ws1:=adoquery1.fieldbyname('Thickness').AsString;
if ws1='16' then
ws:=ws+1;
adoquery1.next
end;
到我邮箱吧:[email protected] .我回你