1、excel 表公式:=--MID($E3027,MIN(FIND({1,2,3,4,5,6,7,8,9,0},$E3027&1234567890)),2)
如:I4BX30L6I3、B25G3K0 、S30G3K 结果 :30 、25 、30
2.excel 表公式:=--MID($E3037,MIN(FIND({"T","I","J","G","W","N"},$E3037&"TIGJWN"))+1,1)
如I4BX30L6I3 、B25G3K0 、 S30G3K 结果 :4 、3 、3
http://jingyan.baidu.com/article/215817f7ee75a01edb142375.html
提取数字
①
function MoneyToInt(const sMoney:string):String;
var
I:Word;
sResult: string;
begin
sResult:='';
if sMoney <>'' then
for I :=1 to Length(sMoney) do
if (sMoney[I] in ['0'..'9','.'])then
sResult := sResult + sMoney[I];
try
Result:=sResult;
except
Result:='';
end;
end;
edt1.Text:=MoneyToInt(mmo1.Lines[0]);
edt2.Text:=MoneyToInt(copy(mmo1.Lines[1],0,14));
edt3.Text:=MoneyToInt(copy(mmo1.Lines[1],14,20));
edt4.Text:=MoneyToInt(Copy(mmo1.Lines[2],0,6));
edt5.Text:=MoneyToInt(Copy(mmo1.Lines[2],6,20));
②
Function TForm1.Setstring(cString:string):string; {提取数字}
VAr
i:integer;
str:string;
begin
str:='';
For i:=1 to length(cString) do
begin
Case cString[i] of
'.': str:=Str+'.';
'0': str:=Str+'0'; '1': str:=Str+'1'; '2': str:=Str+'2';
'3': str:=Str+'3'; '4': str:=Str+'4'; '5': str:=Str+'5';
'6': str:=Str+'6'; '7': str:=Str+'7';
'8': str:=Str+'8'; '9': str:=Str+'9';
end;
end;
Setstring:=str;
end;