Answer the question
In order to leave comments, you need to log in
How to remove unwanted lines?
You need to delete everything from the rezult file that is for 10.01 and write the cleared line back
. The line in the rezult file: 1 888 10.01 "SOPHY CINNAMON" Board Ch HSK
here is the code
var a,str2:string;
i,y:integer;
rezult: text ;
begin
AssignFile(rezult,'c:\way\rezult.txt');
reset(rezult);
while not EOF(rezult) do
begin
readln(rezult,str2);
i:=length(str2);
y:=pos('10.01',str2);
delete(str2,y,i);
Writeln(rezult,str2);
end;
end.
Answer the question
In order to leave comments, you need to log in
Ternary operator. What is before the colon will be returned if the expression is true, otherwise the operator will return what is after the colon.
php.net/manual/en/language.operators.comparison.php
Decided by myself
var a,str2,str3:string;
i,y:integer;
rezult,rezult2: text ;
begin
AssignFile(rezult,'c:\way\rezult.txt');
AssignFile(rezult2,'c:\way\rezult2.txt');
reset(rezult);
rewrite(rezult2);
while not EOF(rezult) do
begin
readln(rezult,str2);
i:=length(str2);
y:=pos('10.01',str2);
delete(str2,y,i);
writeln(rezult2,str2);
end;
close(rezult); close(rezult2);
end.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question