-
Notifications
You must be signed in to change notification settings - Fork 1
/
CATCSV.PAS
44 lines (40 loc) · 1010 Bytes
/
CATCSV.PAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{ @author: Sylvain Maltais (support@gladir.com)
@created: 2024
@website(https://www.gladir.com/csv-tools)
@abstract(Target: Turbo Pascal 7, Free Pascal 3.2)
}
Program CATCSV;
Uses DOS;
Var
I:Integer;
Info:SearchRec;
CurrCSV:Text;
CurrLine:String;
BEGIN
If(ParamStr(1)='/?')or(ParamStr(1)='--help')or(ParamStr(1)='-h')or
(ParamStr(1)='/h')or(ParamStr(1)='/H')Then Begin
WriteLn('CATCSV : Cette commande permet de concat‚ner des fichiers ',
'CSV en un seule CSV.');
WriteLn;
WriteLn('Syntaxe : CATCSV source.CSV [...]');
WriteLn;
WriteLn(' source.CSV Nom des fichiers … fusionner');
WriteLn;
End
Else
If ParamCount>0 Then Begin
For I:=1 to ParamCount do Begin
FindFirst(ParamStr(I),AnyFile,Info);
While DOSError=0 do Begin
{$I-}Assign(CurrCSV,Info.Name);
Reset(CurrCSV);{$I+}
While Not EOF(CurrCSV)do Begin
ReadLn(CurrCSV,CurrLine);
WriteLn(CurrLine);
End;
Close(CurrCSV);
FindNext(Info);
End;
End;
End;
END.