Programming in Pascal
Posted on 2003-02-25
I have the following program written in Pascal that:
1. Reads an ASCHI input file.
2. Searchs for " and replace with blanks.
3. Searchs for "," and replace with ";"
4. Creates new ASCHI file called FileClean.asc
How do I edit the following code, so that the output file automatically takes the name of the input file + extension 'asc'.
For example. Inputfile is called abc.asc -> output file abc.asc
Inputfile is called def.asc -> output file def.asc
The present code looks like this:
F1,F2 : File of char;
c1 : Char;
IF Paramcount<1 Then
WriteLN('Syntax : FileCln <InputFile>');
While Not EOF(F1) Do
Case C1 OF
'"' : C1:=#32;
',' : C1:=';';