第一行是文件头;我需输入第一个卡号和最后一个卡号后,自动将a.text分割成b.text后保存,请问如何实现???原文件a.text:
05031230100062057 05031230100062074 2007-06-30 50
05031230100062057 405757018509636621
05031230100062058 400100424751688294
05031230100062059 400167109113759136
05031230100062060 405609461110912942
05031230100062061 405132037466392258
05031230100062062 405330701829114476
05031230100062063 405494441730329572
05031230100062064 405967799114365404
05031230100062065 405045755703775872
05031230100062066 405259267774234674
05031230100062067 405928088018827981
05031230100062068 405733864242576657
05031230100062069 405493299478123605
05031230100062070 405762853107003383
05031230100062071 405408917343377348
05031230100062072 405618422352710006
05031230100062073 405261222482420728
05031230100062074 405497980857549466分割后的文件b.text:
05031230100062060 05031230100062069 2007-06-30 50
05031230100062060 405609461110912942
05031230100062061 405132037466392258
05031230100062062 405330701829114476
05031230100062063 405494441730329572
05031230100062064 405967799114365404
05031230100062065 405045755703775872
05031230100062066 405259267774234674
05031230100062067 405928088018827981
05031230100062068 405733864242576657
05031230100062069 405493299478123605
05031230100062057 05031230100062074 2007-06-30 50
05031230100062057 405757018509636621
05031230100062058 400100424751688294
05031230100062059 400167109113759136
05031230100062060 405609461110912942
05031230100062061 405132037466392258
05031230100062062 405330701829114476
05031230100062063 405494441730329572
05031230100062064 405967799114365404
05031230100062065 405045755703775872
05031230100062066 405259267774234674
05031230100062067 405928088018827981
05031230100062068 405733864242576657
05031230100062069 405493299478123605
05031230100062070 405762853107003383
05031230100062071 405408917343377348
05031230100062072 405618422352710006
05031230100062073 405261222482420728
05031230100062074 405497980857549466分割后的文件b.text:
05031230100062060 05031230100062069 2007-06-30 50
05031230100062060 405609461110912942
05031230100062061 405132037466392258
05031230100062062 405330701829114476
05031230100062063 405494441730329572
05031230100062064 405967799114365404
05031230100062065 405045755703775872
05031230100062066 405259267774234674
05031230100062067 405928088018827981
05031230100062068 405733864242576657
05031230100062069 405493299478123605
解决方案 »
- 请问:怎么把数据从SQL server 7中导入到SQL server 2000?
- 如何根据指针获取该指针(Pointer)对应的字符串内容
- 如何获得本地连接的名称啊
- 有关IntraWeb的AppMode方式应用服务的问题
- devExpress控件中的DXDBTREEVIEW的用法
- 拖动ScrollBox的滚动条时其中的TGraphicControl子类作的图会乱掉!帮忙,up有分!
- 大家探讨一下吧,把所有的源程式都收集起来,大家互相学习!!
- PageControl的问题
- 十万火急,请问高手,如何实现TAdvStringGrid中的内容向右对齐?给分!!!
- 关于pascal一问
- 此语句如何写
- Dephi7中使用QuickReport为何总出PrinterSettings.ExtendedDuplex错?
var
a,b: TStringList;
I,J,K: integer;
s: string;
begin
a:= TStringList.Create;
b:= TStringList.Create;
a.LoadFromFile('d:\a.txt');
b.Add(edit1.Text+' '+edit2.Text+' '+datetostr(date));
for I:= 1 to a.Count-1 do
begin
s:= trim(copy(a[I],0,pos(' ',a[I])));
if s = edit1.Text then J:= I;
if s = edit2.Text then K:= I;
end;
for I:= J to K do
b.Add(a[I]);
b.SaveToFile('d:\b.txt');
a.Free;
b.Free;
end;
var
a,b: TStringList;
I,J,K: integer;
s: string;
begin
a:= TStringList.Create;
b:= TStringList.Create;
a.LoadFromFile('d:\a.txt');
b.Add(edit1.Text+' '+edit2.Text+' '+datetostr(date));
for I:= 1 to a.Count-1 do
begin
s:= trim(copy(a[I],0,pos(' ',a[I])));
if s = edit1.Text then J:= I;
if s = edit2.Text then K:= I;
end;
for I:= J to K do
b.Add(a[I]);
b.SaveToFile('d:\b.txt');
a.Free;
b.Free;
end;
呵,噌分噌分