Mike Manning's code:
---------------- start code ----------------------------
procedure substitute_ch;
var
F1, F2: textfile;
ch2 : char;
textfile1, textfile2 : string;
begin
textfile1 := // (....source filename)
textfile2 := // (....new filename)
{ open the 2 files etc ....}
assignfile(F1, txtfile1); // sourcefile
reset(F1);
assignfile(F2, txtfile2); // new file
rewrite(F2);
repeat
read(F1,ch2);
if ch2 = #9 then ch2 := #44;
write(F2, ch2);
until eof(F1);
close(F1);
close(F2);
end;
--------------------- end code ---------------------------
Bruce Roberts' revised code (avoiding use of CommaFile):
-------------------- start code --------------------------
procedure ReplaceTabChars (srcFileName : string);
var srcFile,
dstFile : TextFile;
ch : char;
begin
if FileExists (srcFileName)
then begin
AssignFile (srcFile, srcFileName);
Reset (srcFile);
try
AssignFile (dstFile, ChangeFileExt (srcFileName, '.TAB'));
Rewrite (dstFile);
try
while not EOF (srcFile) do
begin
Read (srcFile, ch);
if ch = Char (9)
then Write (dstFile, Chr(34)+Chr(44)+Chr(34))
else Write (dstFile, ch);
end;
finally
CloseFile (dstFile);
end;
finally
CloseFile (srcFile);
end;
end;
-------------------- end code ---------------------------
Quote
t...@nogoodpartsunbeltinc.com wrote in message
<390c85db.80207...@news1.news.adelphia.net>...
Quote
>On Wed, 26 Apr 2000 07:49:59 +0930, "Peter Lawrance" <p...@seol.net.au>
>wrote:
>>Bruce's new code does the trick, as does one Mike Manning sent me
privately.
>Please post his answer to this question so that we may all see it and use
>it.
>-- THANKS!
>Marc / Tech Support Sunbelt Software Inc.
>** EZ Auto Leasing...consumer car & truck leasing software **
>To e-mail, remove "nogoodpart" from t...@nogoodpartsunbeltinc.com
>Web site: remove "nogoodpart" from www.nogoodpartsunbeltinc.com